Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | public function testGetItemForIdThrowsCorrectExceptionType() { |
||
41 | $id = new ItemId( 'Q1' ); |
||
42 | |||
43 | $legacyLookup = new InMemoryEntityLookup(); |
||
44 | $legacyLookup->addException( new EntityLookupException( $id ) ); |
||
45 | |||
46 | $itemLookup = new LegacyAdapterItemLookup( $legacyLookup ); |
||
47 | |||
48 | $this->expectException( ItemLookupException::class ); |
||
49 | $itemLookup->getItemForId( $id ); |
||
50 | } |
||
51 | |||
53 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: