public function testSetDefinition() { $tubePressDefinition = $this->mock('tubepress_internal_ioc_Definition'); $symfonyDefinition = $this->mock('\\Symfony\\Component\\DependencyInjection\\Definition'); $tubePressDefinition->shouldReceive('getUnderlyingSymfonyDefinition')->once()->andReturn($symfonyDefinition); $this->assertFalse($this->_sut->has('x')); $this->assertFalse($this->_sut->hasDefinition('x')); $this->_sut->setDefinition('x', $tubePressDefinition); $this->assertTrue($this->_sut->has('x')); $this->assertTrue($this->_sut->hasDefinition('x')); $result = $this->_sut->getDefinition('x'); $this->assertInstanceOf('tubepress_api_ioc_DefinitionInterface', $result); }