public function abs() { $this->data = Filter::filterArray($this->data, function ($data) { return abs($data); }); $this->flushCache(); return $this; }
/** * Tests if cache will be flushed after using NumArray::abs */ public function testAbsCache() { $numArray = new NumArray(5); $numArray->setCache('key', 6); $numArray->abs(); $this->assertFalse($numArray->inCache('key')); }