11 $restriction =
new $class( 1, 2 );
13 $this->assertSame( $restriction->getBlockId(), 1 );
14 $this->assertSame( $restriction->getValue(), 2 );
19 $restriction =
new $class( 1, 2 );
21 $restriction->setBlockId( 10 );
22 $this->assertSame( $restriction->getBlockId(), 10 );
29 $restriction =
new $class( 1, 2 );
30 $second =
new $class( 1, 2 );
31 $this->assertTrue( $restriction->equals( $second ) );
34 $second = $this->createMock( $this->
getClass() );
35 $this->assertFalse( $restriction->equals( $second ) );
38 $second =
new $class( 2, 2 );
39 $this->assertTrue( $restriction->equals( $second ) );
42 $second =
new $class( 1, 3 );
43 $this->assertFalse( $restriction->equals( $second ) );
49 $restriction = $class::newFromRow( (
object)[
54 $this->assertSame( 1, $restriction->getBlockId() );
55 $this->assertSame( 2, $restriction->getValue() );
61 $restriction =
new $class( 1, 2 );
62 $row = $restriction->toRow();
64 $this->assertSame( 1, $row[
'ir_ipb_id'] );
65 $this->assertSame( 2, $row[
'ir_value'] );
73 abstract protected function getClass();