public function testUnserialize()
 {
     $snak = new PropertyNoValueSnak(new PropertyId('P1'));
     $snak->unserialize('i:2;');
     $expected = new PropertyNoValueSnak(new PropertyId('P2'));
     $this->assertTrue($snak->equals($expected));
 }
Exemplo n.º 2
0
 public function testEqualsMoar()
 {
     $id42 = new PropertyId('p42');
     $snak = new PropertyNoValueSnak($id42);
     $this->assertFalse($snak->equals(new PropertySomeValueSnak($id42)));
     $this->assertFalse($snak->equals(new PropertyValueSnak($id42, new StringValue('Ohi there!'))));
     $id43 = new PropertyId('p43');
     $this->assertFalse($snak->equals(new PropertyNoValueSnak($id43)));
 }
Exemplo n.º 3
0
 public function testMinimalConstructor()
 {
     $mainSnak = new PropertyNoValueSnak(1);
     $statement = new Statement($mainSnak);
     $this->assertTrue($mainSnak->equals($statement->getMainSnak()));
 }