last() public method

Returns the last element from the array
public last ( ) : mixed
return mixed
 public function testMergeCollection()
 {
     $this->collection->merge(new Collection(['test']));
     $this->assertEquals(5, $this->collection->count());
     $this->assertEquals('test', $this->collection->last());
 }
Example #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());
 }