[FEATURE] Add ObjectManager->getScope like in TYPO3.Flow
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Object / Container / ContainerTest.php
index 2dc8514..7e38b27 100644 (file)
@@ -310,6 +310,22 @@ class ContainerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $object = $this->container->getInstance('t3lib_object_prototypeNeedsSingletonInConstructor');
                $this->assertInstanceOf('t3lib_object_singleton', $object->dependency);
        }
+
+       /**
+        * @test
+        */
+       public function isSingletonReturnsTrueForSingletonInstancesAndFalseForPrototypes() {
+               $this->assertTrue($this->container->isSingleton('TYPO3\CMS\Extbase\Object\Container\Container'));
+               $this->assertFalse($this->container->isSingleton('TYPO3\CMS\Extbase\Core\Bootstrap'));
+       }
+
+       /**
+        * @test
+        */
+       public function isPrototypeReturnsFalseForSingletonInstancesAndTrueForPrototypes() {
+               $this->assertFalse($this->container->isPrototype('TYPO3\CMS\Extbase\Object\Container\Container'));
+               $this->assertTrue($this->container->isPrototype('TYPO3\CMS\Extbase\Core\Bootstrap'));
+       }
 }
 
 ?>
\ No newline at end of file