public function testGetGprsHistory() { $sim = $this->simMapper->findOneById("00000000000000000015", self::MASTER_ORG_ID); $data = $this->simMapper->getGprsHistory($sim); $this->assertInternalType('array', $data); $this->assertNotEmpty($data); foreach ($data as $jey => $entry) { $this->assertInstanceOf('\\Application\\Model\\Sim\\GprsHistoryEntryModel', $entry, "Entry no. {$key}"); $this->assertNotNull($entry->ip, "Entry no. {$key}, field ip"); $this->assertNotNull($entry->start_timestamp, "Entry no. {$key}, field start_timestamp"); $this->assertNotNull($entry->end_timestamp, "Entry no. {$key}, field end_timestamp"); $this->assertNotNull($entry->sent_bytes, "Entry no. {$key}, field sent_bytes"); $this->assertNotNull($entry->received_bytes, "Entry no. {$key}, field received_bytes"); $this->assertNotNull($entry->sent_packages, "Entry no. {$key}, field sent_packages"); $this->assertNotNull($entry->received_packages, "Entry no. {$key}, field received_packages"); $this->assertNotNull($entry->cgi, "Entry no. {$key}, field cgi"); } }
public function testGetGprsHistory() { $sim = new \Application\Model\SimModel(); $sim->setImsi("214071000000002"); $from = '2008-11-15T21:07+0000'; $until = '2012-12-14T21:07+0000'; $data = $this->simMapper->getGprsHistory($sim, $from, $until); // Structure $this->assertInternalType('array', $data); $this->assertNotEmpty($data); $this->assertArrayHasKey('ip', $data[0]); $this->assertArrayHasKey('start_timestamp', $data[0]); $this->assertArrayHasKey('end_timestamp', $data[0]); $this->assertArrayHasKey('sent_bytes', $data[0]); $this->assertArrayHasKey('received_bytes', $data[0]); $this->assertArrayHasKey('sent_packages', $data[0]); $this->assertArrayHasKey('received_packages', $data[0]); // Count $this->assertEquals(3, count($data)); }