/** * @test * @todo Old code getAvailableProperties() needs to be replaced by current behaviour */ public function propertiesPassedToConstructorAreAvailableViaGenericGetter() { $this->markTestSkipped('TYPO3\\CMS\\Core\\Resource\\File::getAvailableProperties() does not exist'); $properties = array(uniqid() => uniqid(), uniqid() => uniqid(), 'uid' => 1); $fixture = new \TYPO3\CMS\Core\Resource\File($properties); $availablePropertiesBackup = \TYPO3\CMS\Core\Resource\File::getAvailableProperties(); \TYPO3\CMS\Core\Resource\File::setAvailableProperties(array_keys($properties)); foreach ($properties as $key => $value) { $this->assertTrue($fixture->hasProperty($key)); $this->assertEquals($value, $fixture->getProperty($key)); } $this->assertFalse($fixture->hasProperty(uniqid())); \TYPO3\CMS\Core\Resource\File::setAvailableProperties($availablePropertiesBackup); $this->setExpectedException('InvalidArgumentException', '', 1314226805); $fixture->getProperty(uniqid()); }
/** * @test */ public function hasPropertyReturnsTrueFilePropertyExists() { $fixture = new \TYPO3\CMS\Core\Resource\File(array('testproperty' => 'testvalue'), $this->storageMock); $this->assertTrue($fixture->hasProperty('testproperty')); }