/**
  * {@inheritdoc}
  */
 public function indexOf($element)
 {
     $this->initialize();
     return $this->coll->indexOf($element);
 }
Exemplo n.º 2
0
 public function testSearch()
 {
     $this->_coll[0] = 'test';
     $this->assertEquals(0, $this->_coll->indexOf('test'));
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
 public function hasRole(Role $role)
 {
     $index = $this->roles->indexOf($role);
     return is_numeric($index);
 }
Exemplo n.º 5
0
 public function testSearch()
 {
     $this->collection[0] = 'Test';
     $this->assertEquals(0, $this->collection->indexOf('Test'));
 }
 /**
  * {@inheritdoc}
  */
 public function indexOf($element)
 {
     return $this->inner->indexOf($element);
 }
Exemplo n.º 7
0
 /**
  * {@inheritDoc}
  */
 public function indexOf($element)
 {
     return $this->collection->indexOf($element) === false ? false : $this->getKey($element);
 }
Exemplo n.º 8
0
 /**
  * @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());
 }