Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / tests / phpunit / includes / Revision / SlotRecordTest.php
index 1b6ff2a..6495967 100644 (file)
@@ -77,7 +77,7 @@ class SlotRecordTest extends MediaWikiTestCase {
                $this->assertFalse( $record->isInherited() );
                $this->assertSame( 'A', $record->getContent()->getText() );
                $this->assertSame( 1, $record->getSize() );
-               $this->assertNotNull( $record->getSha1() );
+               $this->assertNotEmpty( $record->getSha1() );
                $this->assertSame( CONTENT_MODEL_WIKITEXT, $record->getModel() );
                $this->assertSame( 2, $record->getRevision() );
                $this->assertSame( 2, $record->getRevision() );
@@ -96,7 +96,7 @@ class SlotRecordTest extends MediaWikiTestCase {
                $this->assertFalse( $record->hasOrigin() );
                $this->assertSame( 'A', $record->getContent()->getText() );
                $this->assertSame( 1, $record->getSize() );
-               $this->assertNotNull( $record->getSha1() );
+               $this->assertNotEmpty( $record->getSha1() );
                $this->assertSame( CONTENT_MODEL_WIKITEXT, $record->getModel() );
                $this->assertSame( 'myRole', $record->getRole() );
        }
@@ -177,6 +177,14 @@ class SlotRecordTest extends MediaWikiTestCase {
                $this->assertSame( $hash, $record->getSha1() );
        }
 
+       public function testHashComputed() {
+               $row = $this->makeRow();
+               $row->content_sha1 = '';
+
+               $rec = new SlotRecord( $row, new WikitextContent( 'A' ) );
+               $this->assertNotEmpty( $rec->getSha1() );
+       }
+
        public function testNewWithSuppressedContent() {
                $input = new SlotRecord( $this->makeRow(), new WikitextContent( 'A' ) );
                $output = SlotRecord::newWithSuppressedContent( $input );