File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,11 @@ public function testReferenceDoesNotEqualReferenceWithDifferentSnakProperty() {
188188 $ this ->assertFalse ( $ reference0 ->equals ( $ reference1 ) );
189189 }
190190
191+ public function testReferenceHashStability () {
192+ $ reference = new Reference ( [ new PropertyNoValueSnak ( 42 ) ] );
193+ $ this ->assertSame ( 'f2be45ba65676e69367433547812db03b8c661ef ' , $ reference ->getHash () );
194+ }
195+
191196 public function testReferenceDoesNotEqualReferenceWithMoreSnaks () {
192197 $ reference0 = new Reference ( [ new PropertyNoValueSnak ( 42 ) ] );
193198
Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ public function testGetGuid( Statement $statement ) {
7979 $ this ->assertEquals ( 'foobar ' , $ statement ->getGuid () );
8080 }
8181
82+ public function testHashStability () {
83+ $ mainSnak = new PropertyNoValueSnak ( new PropertyId ( 'P42 ' ) );
84+ $ statement = new Statement ( $ mainSnak );
85+ $ this ->assertSame ( '50c73da6759fd31868fb0cc9c218969fa776f62c ' , $ statement ->getHash () );
86+ }
87+
8288 public function testSetAndGetMainSnak () {
8389 $ mainSnak = new PropertyNoValueSnak ( new PropertyId ( 'P42 ' ) );
8490 $ statement = new Statement ( $ mainSnak );
You can’t perform that action at this time.
0 commit comments