Skip to content

[WIP][FrameworkBundle] Add debug autoconfigure command #28730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix windows tests
  • Loading branch information
aaa2000 committed Oct 13, 2018
commit 00fb8ae6ad937edaabb825dcad2a02202d86d84c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testBasicFunctionality()
Tag console.command
-------- -----------------
EOD;
$this->assertContains($expectedOutput, $tester->getDisplay());
$this->assertContains($expectedOutput, $tester->getDisplay(true));
}

public function testSearchArgument()
Expand All @@ -52,8 +52,8 @@ public function testSearchArgument()
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'debug:autoconfiguration', 'search' => 'logger'));

$this->assertContains('Psr\Log\LoggerAwareInterface', $tester->getDisplay());
$this->assertNotContains('Sensio\Bundle\FrameworkExtraBundle', $tester->getDisplay());
$this->assertContains('Psr\Log\LoggerAwareInterface', $tester->getDisplay(true));
$this->assertNotContains('Sensio\Bundle\FrameworkExtraBundle', $tester->getDisplay(true));
}

public function testAutoconfigurationWithMethodCalls()
Expand All @@ -66,12 +66,12 @@ public function testAutoconfigurationWithMethodCalls()
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'debug:autoconfiguration', 'search' => 'MethodCalls'));

$this->assertContains('Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\DebugAutoconfigurationBundle\Autoconfiguration\MethodCalls', $tester->getDisplay());
$this->assertContains('Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\DebugAutoconfigurationBundle\Autoconfiguration\MethodCalls', $tester->getDisplay(true));
$expectedMethodCallOutput = <<<EOD
Method call - [setMethodOne, ['@logger']]
- [setMethodTwo, [[paramOne, paramOne]]]
EOD;
$this->assertContains($expectedMethodCallOutput, $tester->getDisplay());
$this->assertContains($expectedMethodCallOutput, $tester->getDisplay(true));
}

public function testAutoconfigurationWithMultipleTagsAttributes()
Expand All @@ -84,7 +84,7 @@ public function testAutoconfigurationWithMultipleTagsAttributes()
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'debug:autoconfiguration', 'search' => 'TagsAttributes'));

$this->assertContains('Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\DebugAutoconfigurationBundle\Autoconfiguration\TagsAttributes', $tester->getDisplay());
$this->assertContains('Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\DebugAutoconfigurationBundle\Autoconfiguration\TagsAttributes', $tester->getDisplay(true));
$expectedTagsAttributesOutput = <<<EOD
Tag debugautoconfiguration.tag1
Tag attribute [
Expand All @@ -100,7 +100,7 @@ public function testAutoconfigurationWithMultipleTagsAttributes()
]
]
EOD;
$this->assertContains($expectedTagsAttributesOutput, $tester->getDisplay());
$this->assertContains($expectedTagsAttributesOutput, $tester->getDisplay(true));
}

public function testAutoconfigurationWithBindings()
Expand All @@ -113,13 +113,13 @@ public function testAutoconfigurationWithBindings()
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'debug:autoconfiguration', 'search' => 'Bindings'));

$this->assertContains('Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\DebugAutoconfigurationBundle\Autoconfiguration\Bindings', $tester->getDisplay());
$this->assertContains('Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\DebugAutoconfigurationBundle\Autoconfiguration\Bindings', $tester->getDisplay(true));
$expectedTagsAttributesOutput = <<<'EOD'
Bindings $paramOne: '@logger'
$paramTwo: 'binding test'

EOD;
$this->assertContains($expectedTagsAttributesOutput, $tester->getDisplay());
$this->assertContains($expectedTagsAttributesOutput, $tester->getDisplay(true));
}

public function testSearchIgnoreBackslashWhenFindingInterfaceOrClass()
Expand All @@ -131,7 +131,7 @@ public function testSearchIgnoreBackslashWhenFindingInterfaceOrClass()

$tester = new ApplicationTester($application);
$tester->run(array('command' => 'debug:autoconfiguration', 'search' => 'PsrLogLoggerAwareInterface'));
$this->assertContains('Psr\Log\LoggerAwareInterface', $tester->getDisplay());
$this->assertContains('Psr\Log\LoggerAwareInterface', $tester->getDisplay(true));
}

public function testSearchNoResults()
Expand Down