last() public method

Returns the last element from the array
public last ( ) : mixed
return mixed
Esempio n. 1
0
 public function testMergeCollection()
 {
     $this->collection->merge(new Collection(['test']));
     $this->assertEquals(5, $this->collection->count());
     $this->assertEquals('test', $this->collection->last());
 }
Esempio n. 2
0
 public function testLast()
 {
     $el = $this->collection->last();
     $this->assertEquals($this->_3, $el);
 }
 /** {@inheritdoc} */
 public function last()
 {
     $this->initialize();
     return $this->coll->last();
 }
 public function testLast()
 {
     $collection = new Collection(['a' => 'c', 'b' => 'd']);
     $this->assertSame('d', $collection->last());
 }