[BUGFIX] Call initializeObject() after instantiating empty objects
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Object / Container / ContainerTest.php
index cfd5d02..9eadf13 100644 (file)
@@ -180,6 +180,14 @@ class ContainerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->assertEquals($className, $this->cachedClassInfo->getClassName());
        }
 
+       /**
+        * @test
+        */
+       public function getInstanceInitializesObjects() {
+               $instance = $this->container->getInstance('t3lib_object_tests_initializable');
+               $this->assertTrue($instance->isInitialized(), 't3lib_object_tests_initializable was not completely initialized');
+       }
+
        /**
         * Callback for getInstanceUsesClassNameSha1AsCacheKey
         *
@@ -207,6 +215,14 @@ class ContainerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->assertInstanceOf('t3lib_object_tests_serializable', $object);
        }
 
+       /**
+        * @test
+        */
+       public function getEmptyObjectInitializesObjects() {
+               $object = $this->container->getEmptyObject('t3lib_object_tests_initializable');
+               $this->assertTrue($object->isInitialized(), 't3lib_object_tests_initializable was not completely initialized');
+       }
+
        /**
         * @test
         */