Bug #62553 » objectstorage-offsetexists-check-object.patch
typo3/sysext/extbase/Classes/Persistence/ObjectStorage.php | ||
---|---|---|
* @return bool
|
||
*/
|
||
public function offsetExists($object) {
|
||
return isset($this->storage[spl_object_hash($object)]);
|
||
return is_object($object) && isset($this->storage[spl_object_hash($object)]);
|
||
}
|
||
/**
|
typo3/sysext/extbase/Tests/Unit/Persistence/ObjectStorageTest.php | ||
---|---|---|
/**
|
||
* @test
|
||
*/
|
||
public function offsetExistsWorksWithEmptyStorageAndIntegerKey() {
|
||
$objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||
$this->assertEquals($objectStorage->offsetExists(0), FALSE);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function offsetExistsWorksWithEmptyStorageAndStringKey() {
|
||
$objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||
$this->assertEquals($objectStorage->offsetExists('0'), FALSE);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function getInfoReturnsTheDataAssociatedWithTheCurrentIteratorEntry() {
|
||
$objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||
$object1 = new \StdClass();
|
- « Previous
- 1
- 2
- Next »