예제 #1
0
 public function getHistory($operation = null)
 {
     $operationToRetrieve = strtolower($operation == null ? $this->currentTotalName : $operation);
     if ($this->operationValues->has($operationToRetrieve)) {
         return $this->operationValues[$operationToRetrieve]->getHistory();
     }
     throw new InvalidArgumentException("Operation {$operationToRetrieve} has not been initialized.");
 }
예제 #2
0
 /**
  * @test
  */
 public function forgetで複数要素を削除する()
 {
     $collection = new Collection(['foo' => 1, 'bar' => 2, 'baz' => 3]);
     $collection->forget(['foo', 'bar']);
     $this->assertFalse($collection->has('foo'));
     $this->assertFalse($collection->has('bar'));
     $this->assertTrue($collection->has('baz'));
 }