[BUGFIX] ProcessedFile is persisted in sys_file as well
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Resource / FileTest.php
index 0bc5fb6..d689ce2 100644 (file)
@@ -392,7 +392,39 @@ class FileTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->assertSame($expectedExtension, $fixture->getExtension());
        }
 
+       /**
+        * @test
+        */
+       public function indexablePropertyIsByDefaultTrue() {
+               $fixture = new \TYPO3\CMS\Core\Resource\File(array());
+               $this->assertAttributeEquals(TRUE, 'indexable', $fixture);
+       }
 
+       /**
+        * @test
+        */
+       public function indexablePropertyCanBeSetAndGet() {
+               $fixture = new \TYPO3\CMS\Core\Resource\File(array());
+               foreach (array(FALSE, TRUE) as $value) {
+                       $fixture->setIndexable($value);
+                       $this->assertSame($value, $fixture->isIndexable());
+               }
+       }
+
+       /**
+        * @test
+        */
+       public function callMethodLoadIndexRecordWithPropertyIndexableSetToFalseAndCheckWhetherIsIndexedReturnsNull() {
+               $method = new \ReflectionMethod(
+                       'TYPO3\CMS\Core\Resource\File', 'loadIndexRecord'
+               );
+               $method->setAccessible(TRUE);
+
+               $fixture = new \TYPO3\CMS\Core\Resource\File(array());
+               $fixture->setIndexable(FALSE);
+               $method->invoke($fixture);
+               $this->assertNull($fixture->isIndexed());
+       }
 }
 
 ?>
\ No newline at end of file