public function testHasItem() { $items = $this->createRandomItems(); $other_items = $this->createRandomItems(); $items_count = count($items); $last_index = $items_count - 1; // pick a random item from the list to test against $random_key = 0; if ($last_index > 0) { $random_key = self::$faker->numberBetween(0, $last_index); } $random_item = $items[$random_key]; $list = new ArrayList($items); $this->assertEquals(true, $list->hasItem($random_item)); $this->assertEquals(false, $list->hasItem($other_items[0])); }