コード例 #1
0
 public function testAllowsToRetrieveService()
 {
     $slug = 'foo';
     $service = 'bar';
     $application = $this->getApplicationMock();
     $application->expects($this->once())->method('offsetGet')->with($this->identicalTo($slug))->willReturn($service);
     $containerAware = new ContainerAwareFake();
     $containerAware->setApplication($application);
     $this->assertSame($service, $containerAware->getService($slug));
 }
コード例 #2
0
 public function testAllowsToRetrieveService()
 {
     $slug = 'foo';
     $service = 'bar';
     $application = $this->getApplicationMock();
     $application->shouldReceive('offsetGet')->once()->with($slug)->andReturn($service);
     $containerAware = new ContainerAwareFake();
     $containerAware->setApplication($application);
     $this->assertSame($service, $containerAware->getService($slug));
 }