| @@ 30-48 (lines=19) @@ | ||
| 27 | * @test | |
| 28 | * @runInSeparateProcess | |
| 29 | */ | |
| 30 | public function itDisplaysAdvisorsDebugInfo() | |
| 31 |     { | |
| 32 |         $process = new Process(sprintf('php %s debug:advisor', realpath(__DIR__.'/../Fixtures/project/bin/console'))); | |
| 33 | $process->run(); | |
| 34 | ||
| 35 | $this->assertTrue($process->isSuccessful(), 'Unable to execute "debug:advisor" command.'); | |
| 36 | ||
| 37 | $output = $process->getOutput(); | |
| 38 | ||
| 39 | $expected = [ | |
| 40 | 'List of registered advisors in the container', | |
| 41 | 'Go\Symfony\GoAopBundle\Tests\TestProject\Aspect\LoggingAspect->beforeMethod', | |
| 42 | '@execution(Go\Symfony\GoAopBundle\Tests\TestProject\Annotation\Loggable)', | |
| 43 | ]; | |
| 44 | ||
| 45 |         foreach ($expected as $string) { | |
| 46 | $this->assertContains($string, $output); | |
| 47 | } | |
| 48 | } | |
| 49 | ||
| 50 | /** | |
| 51 | * @test | |
| @@ 54-71 (lines=18) @@ | ||
| 51 | * @test | |
| 52 | * @runInSeparateProcess | |
| 53 | */ | |
| 54 | public function itDisplaysStatedAdvisorDebugInfo() | |
| 55 |     { | |
| 56 |         $process = new Process(sprintf('php %s debug:advisor --advisor="Go\Symfony\GoAopBundle\Tests\TestProject\Aspect\LoggingAspect->beforeMethod"', realpath(__DIR__.'/../Fixtures/project/bin/console'))); | |
| 57 | $process->run(); | |
| 58 | ||
| 59 | $this->assertTrue($process->isSuccessful(), 'Unable to execute "debug:advisor" command.'); | |
| 60 | ||
| 61 | $output = $process->getOutput(); | |
| 62 | ||
| 63 | $expected = [ | |
| 64 | 'Total 3 files to analyze.', | |
| 65 | '-> matching method Go\Symfony\GoAopBundle\Tests\TestProject\Application\Main->doSomething', | |
| 66 | ]; | |
| 67 | ||
| 68 |         foreach ($expected as $string) { | |
| 69 | $this->assertContains($string, $output); | |
| 70 | } | |
| 71 | } | |
| 72 | } | |
| 73 | ||
| @@ 33-51 (lines=19) @@ | ||
| 30 | * @test | |
| 31 | * @runInSeparateProcess | |
| 32 | */ | |
| 33 | public function itDisplaysAspectsDebugInfo() | |
| 34 |     { | |
| 35 |         $process = new Process(sprintf('php %s debug:aspect', realpath(__DIR__.'/../Fixtures/project/bin/console'))); | |
| 36 | $process->run(); | |
| 37 | ||
| 38 | $this->assertTrue($process->isSuccessful(), 'Unable to execute "debug:aspect" command.'); | |
| 39 | ||
| 40 | $output = $process->getOutput(); | |
| 41 | ||
| 42 | $expected = [ | |
| 43 | 'Go\Symfony\GoAopBundle\Kernel\AspectSymfonyKernel has following enabled aspects', | |
| 44 | 'Go\Symfony\GoAopBundle\Tests\TestProject\Aspect\LoggingAspect', | |
| 45 | 'Go\Symfony\GoAopBundle\Tests\TestProject\Aspect\LoggingAspect->beforeMethod' | |
| 46 | ]; | |
| 47 | ||
| 48 |         foreach ($expected as $string) { | |
| 49 | $this->assertContains($string, $output); | |
| 50 | } | |
| 51 | } | |
| 52 | } | |
| 53 | ||