@@ -79,13 +79,6 @@ public function testSetAndGetDataTypeId() {
7979 }
8080 }
8181
82- public function testWhenIdSetWithNumber_GetIdReturnsPropertyId () {
83- $ property = Property::newFromType ( 'string ' );
84- $ property ->setId ( 42 );
85-
86- $ this ->assertHasCorrectIdType ( $ property );
87- }
88-
8982 protected function assertHasCorrectIdType ( Property $ property ) {
9083 $ this ->assertInstanceOf ( PropertyId::class, $ property ->getId () );
9184 }
@@ -103,7 +96,7 @@ public function testPropertyWithTypeIsEmpty() {
10396
10497 public function testPropertyWithIdIsEmpty () {
10598 $ property = Property::newFromType ( 'string ' );
106- $ property ->setId ( 1337 );
99+ $ property ->setId ( new PropertyId ( ' P1337 ' ) );
107100 $ this ->assertTrue ( $ property ->isEmpty () );
108101 }
109102
@@ -144,10 +137,10 @@ public function equalsProvider() {
144137 $ secondProperty ->setStatements ( $ this ->newNonEmptyStatementList () );
145138
146139 $ secondPropertyWithId = $ secondProperty ->copy ();
147- $ secondPropertyWithId ->setId ( 42 );
140+ $ secondPropertyWithId ->setId ( new PropertyId ( ' P42 ' ) );
148141
149142 $ differentId = $ secondPropertyWithId ->copy ();
150- $ differentId ->setId ( 43 );
143+ $ differentId ->setId ( new PropertyId ( ' P43 ' ) );
151144
152145 return [
153146 [ Property::newFromType ( 'string ' ), Property::newFromType ( 'string ' ) ],
@@ -168,7 +161,7 @@ public function testEquals( Property $firstProperty, Property $secondProperty )
168161 private function getBaseProperty () {
169162 $ property = Property::newFromType ( 'string ' );
170163
171- $ property ->setId ( 42 );
164+ $ property ->setId ( new PropertyId ( ' P42 ' ) );
172165 $ property ->setLabel ( 'en ' , 'Same ' );
173166 $ property ->setDescription ( 'en ' , 'Same ' );
174167 $ property ->setAliases ( 'en ' , [ 'Same ' ] );
@@ -407,7 +400,7 @@ public function instanceProvider() {
407400
408401 // ID only
409402 $ entity = clone $ entity ;
410- $ entity ->setId ( 44 );
403+ $ entity ->setId ( new PropertyId ( ' P44 ' ) );
411404
412405 $ entities [] = $ entity ;
413406
@@ -421,7 +414,7 @@ public function instanceProvider() {
421414
422415 // with labels etc and ID
423416 $ entity = clone $ entity ;
424- $ entity ->setId ( 42 );
417+ $ entity ->setId ( new PropertyId ( ' P42 ' ) );
425418
426419 $ entities [] = $ entity ;
427420
0 commit comments