Esempio n. 1
0
 /**
  * @covers Phramework\LogJSONAPI\Models\SystemLog::get
  */
 public function testGet()
 {
     SystemLogAdapter::prepare();
     $page = (object) ['limit' => 2, 'offset' => 1];
     $sort = (object) ['attribute' => 'id', 'table' => SystemLogAdapter::getTable(), 'ascending' => false];
     $data = SystemLog::get($page, null, $sort);
     $this->assertNotEmpty($data);
     $this->assertLessThanOrEqual($page->limit, count($data));
     $this->assertInternalType('array', $data);
     $this->assertInternalType('object', $data[0]);
     $this->assertObjectHasAttribute('id', $data[0]);
     $this->assertObjectHasAttribute('type', $data[0]);
     $this->assertObjectHasAttribute('attributes', $data[0]);
     return $data[0]->id;
 }