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

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Frömer committed Jun 17, 2019
1 parent 423e4c6 commit bfd0c48
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/Generator/FileGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()]);
}
}

0 comments on commit bfd0c48

Please sign in to comment.