1 | <?php |
||
7 | class AvailabilityTest extends AbstractTestCase |
||
8 | { |
||
9 | public function testFindReturnsAvailabilityModel() |
||
10 | { |
||
11 | $this->insertAvailability(1, 'EA', 1, 1); |
||
12 | $mapper = $this->getMapper(); |
||
13 | $data = array( |
||
14 | 'product_id' => 1, |
||
15 | 'uom_code' => 'EA', |
||
16 | 'quantity' => 1, |
||
17 | 'distributor_id' => 1, |
||
18 | ); |
||
19 | $result = $mapper->find($data); |
||
20 | $this->assertTrue($result instanceof \SpeckCatalog\Model\Availability); |
||
21 | } |
||
22 | |||
23 | public function testGetByProductUomReturnsArrayOfAvailabilityModels() |
||
24 | { |
||
25 | $this->insertAvailability(1, 'EA', 1, 1); |
||
26 | $mapper = $this->getMapper(); |
||
27 | $result = $mapper->getByProductUom(1, 'EA', 1); |
||
28 | $this->assertTrue(is_array($result)); |
||
29 | $this->assertTrue($result[0] instanceof \SpeckCatalog\Model\Availability); |
||
30 | } |
||
31 | |||
32 | public function getMapper() |
||
36 | } |
||
37 |