Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit bfd0c48

Browse files
author
Andreas Frömer
committed
Improve test coverage
1 parent 423e4c6 commit bfd0c48

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/Generator/FileGeneratorTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,4 +541,13 @@ class SampleClass
541541
$actual = file_get_contents(sys_get_temp_dir() . '/result_file.php');
542542
$this->assertEquals($expected, $actual);
543543
}
544+
545+
public function testWrongDeclareTypeShouldRaiseException(): void
546+
{
547+
$generator = new FileGenerator();
548+
549+
$this->expectException(InvalidArgumentException::class);
550+
$this->expectExceptionMessage('setDeclares is expecting an array of Zend\\Code\\DeclareStatement objects');
551+
$generator->setDeclares([new \stdClass()]);
552+
}
544553
}

0 commit comments

Comments
 (0)