/** * @expectedException \InvalidArgumentException */ public function testOmmitingNameFails() { $container = new \Stark\core\Container(); $propertiesMock = $this->getMock('\\Stark\\core\\Properties', array('set')); $propertiesMock->expects($this->never())->method('set'); $container->setProperties($propertiesMock); $this->propertyTask->setContainer($container); $this->propertyTask->setValue('test'); $this->propertyTask->execute(); }
public function testinitializeDefault() { $time = time(); $properties = new Properties(); $container = new \Stark\core\Container(); $container['timestamp'] = $time; $repoMock = $this->getMock('Stark\\core\\Repository', array('getFileContent', 'getComment', 'getAuthor', 'getChangedFilesCollection')); $repoMock->expects($this->once())->method('getComment')->will($this->returnValue('message')); $repoMock->expects($this->once())->method('getAuthor')->will($this->returnValue('author')); $container->setRepo($repoMock); $properties->setContainer($container); $properties->initializeDefault(); $this->assertEquals($properties->get('timestamp'), $time); $this->assertEquals($properties->get('author'), 'author'); $this->assertEquals($properties->get('message'), 'message'); $this->assertEquals($properties->get('author'), 'author'); $this->assertEquals($properties->get('message'), 'message'); }