/** * {@inheritdoc} */ public function indexOf($element) { $this->initialize(); return $this->coll->indexOf($element); }
public function testSearch() { $this->_coll[0] = 'test'; $this->assertEquals(0, $this->_coll->indexOf('test')); }
function it_does_not_contain_index_of_elements_of_type_other_than_specified(Collection $internal) { $this->indexOf(4)->shouldBe(false); $internal->indexOf(Argument::any())->shouldNotHaveBeenCalled(); }
public function hasRole(Role $role) { $index = $this->roles->indexOf($role); return is_numeric($index); }
public function testSearch() { $this->collection[0] = 'Test'; $this->assertEquals(0, $this->collection->indexOf('Test')); }
/** * {@inheritdoc} */ public function indexOf($element) { return $this->inner->indexOf($element); }
/** * {@inheritDoc} */ public function indexOf($element) { return $this->collection->indexOf($element) === false ? false : $this->getKey($element); }
/** * @dataProvider provideCollection */ public function testIndexOf(Collection $coll, array $elements) { $keys = array_keys($elements); $this->assertSame(current($keys), $coll->indexOf(current($elements))); $this->assertSame(end($keys), $coll->indexOf(end($elements))); $this->assertFalse($coll->indexOf('this-will-surely-not-exist')); }
/** * return int */ public function getMainAliasId() { return $this->aliases->indexOf($this->getMainAlias()); }