Skip to content

Commit

Permalink
tests: Fixed setup of integration test
Browse files Browse the repository at this point in the history
- Added one more test case for configuration class
  • Loading branch information
MontealegreLuis committed Aug 17, 2021
1 parent 5c7e490 commit 4543537
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/src/ContractTests/ImageProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ abstract function processor(): ImageProcessor;
*/
function it_generates_an_image_from_a_dot_file()
{
$finder = (new Finder())->contains('phuml')->in(sys_get_temp_dir());
foreach ($finder as $file) {
unlink($file->getRealPath());
}
$digraph = new OutputContent((string) file_get_contents(__DIR__ . '/../../resources/.fixtures/classes.dot'));
$name = strtolower($this->processor()->name());
$expectedImage = __DIR__ . "/../../resources/.fixtures/${name}.png";
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Code/Variables/TypeDeclarationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function it_extracts_reference_types_from_union_types()
}

/** @test */
function it_knows_if_its_built_in_array_type()
function it_knows_if_it_is_built_in_array_type()
{
$string = TypeDeclaration::from('string');
$arrayOfString = TypeDeclaration::from('string[]');
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/Configuration/GraphvizConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@

final class GraphvizConfigurationTest extends TestCase
{
/** @test */
function it_expects_theme_name_to_be_a_string()
{
$this->options['theme'] = 1;
$this->expectException(InvalidArgumentException::class);

new GraphvizConfiguration($this->options);
}

/** @test */
function it_fails_to_set_an_invalid_theme_name()
{
Expand Down

0 comments on commit 4543537

Please sign in to comment.