Skip to content

Commit

Permalink
Test paths to directories are properly assembled and in debug mode pr…
Browse files Browse the repository at this point in the history
…inted to output
  • Loading branch information
OndraM committed May 25, 2015
1 parent 7468f53 commit b364e7f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src-tests/Console/Command/RunTestsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Lmc\Steward\Process\ProcessSetCreator;
use Lmc\Steward\Selenium\SeleniumServerAdapter;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Finder\Finder;
Expand Down Expand Up @@ -105,6 +106,29 @@ public function directoryOptionsProvider()
];
}

public function testShouldOutputAssembledPathsToDirectoriesInDebugMode()
{
$seleniumAdapterMock = $this->getSeleniumAdapterMock();
$this->command->setSeleniumAdapter($seleniumAdapterMock);

$this->tester->execute(
[
'command' => $this->command->getName(),
'environment' => 'staging',
'browser' => 'firefox',
'--tests-dir' => __DIR__ . '/Fixtures/DummyTests',
'--pattern' => 'NotExisting.foo' // so the test stops execution
],
['verbosity' => OutputInterface::VERBOSITY_DEBUG]
);

$output = $this->tester->getDisplay();
$this->assertContains('Base path to fixtures results: ' . realpath(__DIR__) . '/Fixtures/tests', $output);
$this->assertContains('Path to logs: ' . realpath(__DIR__) . '/Fixtures/logs', $output);
$this->assertContains(' - in directory "' . realpath(__DIR__) . '/Fixtures/DummyTests"', $output);
$this->assertSame(1, $this->tester->getStatusCode());
}

/**
* @dataProvider browserNameProvider
* @param string $browserName
Expand Down

0 comments on commit b364e7f

Please sign in to comment.