Skip to content

Commit

Permalink
Update VisualizerTask tests (#1676)
Browse files Browse the repository at this point in the history
  • Loading branch information
jawira authored Jun 23, 2022
1 parent 453bfa2 commit db6d594
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions tests/Phing/Task/Optional/VisualizerTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
*/
class VisualizerTaskTest extends BuildFileTest
{
/**
* @throws \Phing\Io\IOException
*/
public function setUp(): void
{
$this->configureProject(PHING_TEST_BASE . '/etc/tasks/ext/visualizer/VisualizerTaskTest.xml');
Expand Down Expand Up @@ -68,6 +71,17 @@ public function testDestinationFile(): void
$this->assertFileSizeAtLeast(PHING_TEST_BASE . '/tmp/my-diagram.puml', 1200);
}

/**
* Testing file extension is the same as the one declared with `format`.
*/
public function testDestinationFileExtension(): void
{
$this->executeTarget(__FUNCTION__);
$this->assertFileExists(PHING_TEST_BASE . '/tmp/my-diagram.png.puml');
$this->assertInLogs('my-diagram.png.puml');
$this->assertFileSizeAtLeast(PHING_TEST_BASE . '/tmp/my-diagram.png.puml', 1200);
}

/**
* Testing custom destination without filename.
*/
Expand Down
4 changes: 4 additions & 0 deletions tests/etc/tasks/ext/visualizer/VisualizerTaskTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<visualizer format="puml" destination="../../../../tmp/my-diagram.puml"/>
</target>

<target name="testDestinationFileExtension">
<visualizer format="puml" destination="../../../../tmp/my-diagram.png"/>
</target>

<target name="testDestinationDirectory">
<visualizer format="puml" destination="../../../../tmp/"/>
</target>
Expand Down

0 comments on commit db6d594

Please sign in to comment.