-
Notifications
You must be signed in to change notification settings - Fork 11
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
Remove deprecated warning on DebugClassLoader #22
Changes from 9 commits
389870a
30df508
6dd661f
7b26c6c
bea255c
44e2472
fc8dce2
652dc9d
911503f
3da8bd7
b60f270
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ composer.phar | |
vendor/* | ||
.idea/* | ||
/phpunit.xml | ||
var/cache/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ class ContainerInteractionTest extends AbstractFunctionalTest | |
/** | ||
* @test Get a Symfony entry from PHP-DI's container | ||
*/ | ||
public function phpdi_should_get_entries_from_symfony() | ||
public function phpdiShouldGetEntriesFromSymfony() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you restore the original name? (including in the other tests) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
{ | ||
$kernel = $this->createKernel('class2.yml'); | ||
|
||
|
@@ -42,7 +42,7 @@ public function phpdi_should_get_entries_from_symfony() | |
|
||
$class1 = $container->get('foo'); | ||
|
||
$this->assertTrue($class1 instanceof Class1); | ||
$this::assertTrue($class1 instanceof Class1); | ||
} | ||
|
||
/** | ||
|
@@ -54,13 +54,13 @@ public function symfonyGetInPHPDI() | |
|
||
$class1 = $kernel->getContainer()->get('class1'); | ||
|
||
$this->assertTrue($class1 instanceof Class1); | ||
$this::assertTrue($class1 instanceof Class1); | ||
} | ||
|
||
/** | ||
* @test Alias a Symfony entry from PHP-DI's container | ||
*/ | ||
public function phpdi_aliases_can_reference_symfony_entries() | ||
public function phpdiAliasesCanReferenceSymfonyEntries() | ||
{ | ||
$kernel = $this->createKernel('class2.yml'); | ||
|
||
|
@@ -75,6 +75,6 @@ public function phpdi_aliases_can_reference_symfony_entries() | |
|
||
$class2 = $container->get('foo'); | ||
|
||
$this->assertTrue($class2 instanceof Class2); | ||
$this::assertTrue($class2 instanceof Class2); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,39 +11,41 @@ | |
|
||
use DI\Bridge\Symfony\SymfonyContainerBridge; | ||
use DI\ContainerBuilder; | ||
use PHPUnit\Framework\TestCase; | ||
use Psr\Container\ContainerInterface; | ||
use Symfony\Component\DependencyInjection\ContainerInterface as SfContainerInterface; | ||
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; | ||
|
||
class SymfonyContainerBridgeTest extends \PHPUnit_Framework_TestCase | ||
class SymfonyContainerBridgeTest extends TestCase | ||
{ | ||
public function testHasFallback() | ||
{ | ||
$wrapper = new SymfonyContainerBridge(); | ||
|
||
$fallback = $this->getMockForAbstractClass(ContainerInterface::class); | ||
$fallback->expects($this->once()) | ||
$fallback->expects(self::once()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idem Once method are static. |
||
->method('has') | ||
->with('foo') | ||
->will($this->returnValue(false)); | ||
->will(self::returnValue(false)); | ||
|
||
$wrapper->setFallbackContainer($fallback); | ||
|
||
$this->assertFalse($wrapper->has('foo')); | ||
$this::assertFalse($wrapper->has('foo')); | ||
} | ||
|
||
public function testGetFallback() | ||
{ | ||
$wrapper = new SymfonyContainerBridge(); | ||
|
||
$fallback = $this->getMockForAbstractClass(ContainerInterface::class); | ||
$fallback->expects($this->once()) | ||
$fallback->expects(self::once()) | ||
->method('get') | ||
->with('foo') | ||
->will($this->returnValue('bar')); | ||
->will(self::returnValue('bar')); | ||
|
||
$wrapper->setFallbackContainer($fallback); | ||
|
||
$this->assertEquals('bar', $wrapper->get('foo')); | ||
$this::assertEquals('bar', $wrapper->get('foo')); | ||
} | ||
|
||
public function testGetNotFoundReturnNull() | ||
|
@@ -52,18 +54,17 @@ public function testGetNotFoundReturnNull() | |
|
||
$wrapper->setFallbackContainer(ContainerBuilder::buildDevContainer()); | ||
|
||
$this->assertNull($wrapper->get('foo', SfContainerInterface::NULL_ON_INVALID_REFERENCE)); | ||
$this::assertNull($wrapper->get('foo', SfContainerInterface::NULL_ON_INVALID_REFERENCE)); | ||
} | ||
|
||
/** | ||
* @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException | ||
*/ | ||
public function testGetNotFoundException() | ||
{ | ||
$this->expectException(ServiceNotFoundException::class); | ||
|
||
$wrapper = new SymfonyContainerBridge(); | ||
|
||
$wrapper->setFallbackContainer(ContainerBuilder::buildDevContainer()); | ||
|
||
$this->assertNull($wrapper->get('foo')); | ||
$this::assertNull($wrapper->get('foo')); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These code-style changes are unrelated to the PR, could you revert them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert method are static.