From bfd0c485ba84b334d61bcf27d25e1c96efd5220e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 17 Jun 2019 11:31:30 +0200 Subject: [PATCH] Improve test coverage --- test/Generator/FileGeneratorTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/Generator/FileGeneratorTest.php b/test/Generator/FileGeneratorTest.php index 98c8f05e..fab3fdc9 100644 --- a/test/Generator/FileGeneratorTest.php +++ b/test/Generator/FileGeneratorTest.php @@ -541,4 +541,13 @@ class SampleClass $actual = file_get_contents(sys_get_temp_dir() . '/result_file.php'); $this->assertEquals($expected, $actual); } + + public function testWrongDeclareTypeShouldRaiseException(): void + { + $generator = new FileGenerator(); + + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('setDeclares is expecting an array of Zend\\Code\\DeclareStatement objects'); + $generator->setDeclares([new \stdClass()]); + } }