public function test_accessors() { /** === Test Data === */ $LOT_REF = 'lot ref'; $STOCK_ITEM_REF = 'stock item ref'; $TOTAL = 'total'; /** === Call and asserts === */ $this->obj->setLotRef($LOT_REF); $this->obj->setStockItemRef($STOCK_ITEM_REF); $this->obj->setTotal($TOTAL); $this->assertEquals($LOT_REF, $this->obj->getLotRef()); $this->assertEquals($STOCK_ITEM_REF, $this->obj->getStockItemRef()); $this->assertEquals($TOTAL, $this->obj->getTotal()); }
/** * get the current value which is a summary of the tally and serial inventories. */ public function value() { return bcadd(parent::value(), $this->tally()); }
/** * Tests Capacity::cleanup */ public function testCleanupDeleteFilesCountingCurrentBackup() { $fileList = $this->getFileMockList(array(array('size' => 100, 'shouldBeDeleted' => true))); $resultStub = $this->getMockBuilder('\\phpbu\\App\\Result')->getMock(); $collectorStub = $this->getMockBuilder('\\phpbu\\App\\Backup\\Collector')->disableOriginalConstructor()->getMock(); $targetStub = $this->getMockBuilder('\\phpbu\\App\\Backup\\Target')->disableOriginalConstructor()->getMock(); $collectorStub->method('getBackupFiles')->willReturn($fileList); $cleaner = new Quantity(); $cleaner->setup(array('amount' => '1')); $cleaner->cleanup($targetStub, $collectorStub, $resultStub); }
function __construct($amount, Enumerable $Unit) { parent::__construct($amount, $unit); }