improved calendar (#784)
This commit is contained in:
@@ -16,7 +16,9 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \App\Command\RunCodestyleCommand
|
||||
* @covers \App\Command\RunCodestyleCommand
|
||||
* @covers \App\Command\BashExecutor
|
||||
* @covers \App\Command\BashResult
|
||||
* @group integration
|
||||
*/
|
||||
class RunCodestyleCommandTest extends KernelTestCase
|
||||
@@ -47,7 +49,7 @@ class RunCodestyleCommandTest extends KernelTestCase
|
||||
public function testSuccessCommandNoOptions()
|
||||
{
|
||||
$command = $this->assertSuccessCommand([]);
|
||||
$this->assertStringStartsWith('/vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=none --format=txt', $command);
|
||||
$this->assertStringStartsWith('/vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=none', $command);
|
||||
}
|
||||
|
||||
public function testSuccessCommandFix()
|
||||
@@ -56,16 +58,15 @@ class RunCodestyleCommandTest extends KernelTestCase
|
||||
$this->assertStringStartsWith('/vendor/bin/php-cs-fixer fix', $command);
|
||||
}
|
||||
|
||||
public function testSuccessCommandCheckstyle()
|
||||
public function testSuccessCommand()
|
||||
{
|
||||
$command = $this->assertSuccessCommand(['--checkstyle' => 'phpcs.txt']);
|
||||
$this->assertStringStartsWith('/vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=none > ', $command);
|
||||
$this->assertStringEndsWith('phpcs.txt', $command);
|
||||
$command = $this->assertSuccessCommand([]);
|
||||
$this->assertStringStartsWith('/vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=none', $command);
|
||||
}
|
||||
|
||||
protected function assertSuccessCommand(array $options)
|
||||
{
|
||||
$result = new BashResult(0, 'FooBar');
|
||||
$result = new BashResult(0);
|
||||
$this->executor->setResult($result);
|
||||
|
||||
$command = $this->application->find('kimai:codestyle');
|
||||
@@ -74,7 +75,6 @@ class RunCodestyleCommandTest extends KernelTestCase
|
||||
$commandTester->execute($inputs);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertContains('FooBar', $output);
|
||||
$this->assertContains('[OK] All source files have proper code styles', $output);
|
||||
|
||||
return $this->executor->getCommand();
|
||||
@@ -82,7 +82,7 @@ class RunCodestyleCommandTest extends KernelTestCase
|
||||
|
||||
public function testFailureCommand()
|
||||
{
|
||||
$result = new BashResult(1, 'BarFoo');
|
||||
$result = new BashResult(1);
|
||||
$this->executor->setResult($result);
|
||||
|
||||
$command = $this->application->find('kimai:codestyle');
|
||||
@@ -91,7 +91,6 @@ class RunCodestyleCommandTest extends KernelTestCase
|
||||
$commandTester->execute($inputs);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertContains('BarFoo', $output);
|
||||
$this->assertContains('[ERROR] Found problems while checking your code styles', $output);
|
||||
$this->assertContains('[ERROR] Found violations while checking code styles', $output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \App\Command\RunIntegrationTestsCommand
|
||||
* @covers \App\Command\RunIntegrationTestsCommand
|
||||
* @covers \App\Command\BashExecutor
|
||||
* @covers \App\Command\BashResult
|
||||
* @group integration
|
||||
*/
|
||||
class RunIntegrationTestsCommandTest extends RunUnitTestsCommandTest
|
||||
@@ -45,7 +47,7 @@ class RunIntegrationTestsCommandTest extends RunUnitTestsCommandTest
|
||||
|
||||
public function testSuccessCommand()
|
||||
{
|
||||
$result = new BashResult(0, 'FooBar');
|
||||
$result = new BashResult(0);
|
||||
$this->executor->setResult($result);
|
||||
|
||||
$command = $this->application->find('kimai:test-integration');
|
||||
@@ -54,16 +56,15 @@ class RunIntegrationTestsCommandTest extends RunUnitTestsCommandTest
|
||||
$commandTester->execute($inputs);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertContains('FooBar', $output);
|
||||
$this->assertContains('[OK] All tests were successful', $output);
|
||||
|
||||
$this->assertStringStartsWith('/bin/phpunit --group integration', $this->executor->getCommand());
|
||||
$this->assertStringStartsWith('/vendor/bin/phpunit --group integration', $this->executor->getCommand());
|
||||
$this->assertContains($this->directory, $this->executor->getCommand());
|
||||
}
|
||||
|
||||
public function testFailureCommand()
|
||||
{
|
||||
$result = new BashResult(1, 'BarFoo');
|
||||
$result = new BashResult(1);
|
||||
$this->executor->setResult($result);
|
||||
|
||||
$command = $this->application->find('kimai:test-integration');
|
||||
@@ -72,10 +73,9 @@ class RunIntegrationTestsCommandTest extends RunUnitTestsCommandTest
|
||||
$commandTester->execute($inputs);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertContains('BarFoo', $output);
|
||||
$this->assertContains('[ERROR] Found problems while running tests', $output);
|
||||
|
||||
$this->assertStringStartsWith('/bin/phpunit --group integration', $this->executor->getCommand());
|
||||
$this->assertStringStartsWith('/vendor/bin/phpunit --group integration', $this->executor->getCommand());
|
||||
$this->assertContains($this->directory, $this->executor->getCommand());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,9 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \App\Command\RunUnitTestsCommand
|
||||
* @covers \App\Command\RunUnitTestsCommand
|
||||
* @covers \App\Command\BashExecutor
|
||||
* @covers \App\Command\BashResult
|
||||
* @group integration
|
||||
*/
|
||||
class RunUnitTestsCommandTest extends KernelTestCase
|
||||
@@ -46,7 +48,7 @@ class RunUnitTestsCommandTest extends KernelTestCase
|
||||
|
||||
public function testSuccessCommand()
|
||||
{
|
||||
$result = new BashResult(0, 'FooBar');
|
||||
$result = new BashResult(0);
|
||||
$this->executor->setResult($result);
|
||||
|
||||
$command = $this->application->find('kimai:test-unit');
|
||||
@@ -55,16 +57,15 @@ class RunUnitTestsCommandTest extends KernelTestCase
|
||||
$commandTester->execute($inputs);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertContains('FooBar', $output);
|
||||
$this->assertContains('[OK] All tests were successful', $output);
|
||||
|
||||
$this->assertStringStartsWith('/bin/phpunit --exclude-group integration', $this->executor->getCommand());
|
||||
$this->assertStringStartsWith('/vendor/bin/phpunit --exclude-group integration', $this->executor->getCommand());
|
||||
$this->assertContains($this->directory, $this->executor->getCommand());
|
||||
}
|
||||
|
||||
public function testFailureCommand()
|
||||
{
|
||||
$result = new BashResult(1, 'BarFoo');
|
||||
$result = new BashResult(1);
|
||||
$this->executor->setResult($result);
|
||||
|
||||
$command = $this->application->find('kimai:test-unit');
|
||||
@@ -73,10 +74,9 @@ class RunUnitTestsCommandTest extends KernelTestCase
|
||||
$commandTester->execute($inputs);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertContains('BarFoo', $output);
|
||||
$this->assertContains('[ERROR] Found problems while running tests', $output);
|
||||
|
||||
$this->assertStringStartsWith('/bin/phpunit --exclude-group integration', $this->executor->getCommand());
|
||||
$this->assertStringStartsWith('/vendor/bin/phpunit --exclude-group integration', $this->executor->getCommand());
|
||||
$this->assertContains($this->directory, $this->executor->getCommand());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \App\Command\VersionCommand
|
||||
* @covers \App\Command\VersionCommand
|
||||
* @group integration
|
||||
*/
|
||||
class VersionCommandTest extends KernelTestCase
|
||||
|
||||
Reference in New Issue
Block a user