Example #1
0
 public function testSetAndGetModel()
 {
     $savedReport = new SavedReport();
     $savedReport->name = 'some report';
     $savedReport->description = 'description';
     $savedReport->moduleClassName = 'moduleClassName';
     $savedReport->type = 'some type';
     $savedReport->serializedData = serialize(array('something'));
     $saved = $savedReport->save();
     $this->assertTrue($saved);
     $savedReportId = $savedReport->id;
     $savedReport->forget();
     $savedReport = SavedReport::getById($savedReportId);
     $this->assertEquals('some report', $savedReport->name);
     $this->assertEquals('description', $savedReport->description);
     $this->assertEquals('moduleClassName', $savedReport->moduleClassName);
     $this->assertEquals('some type', $savedReport->type);
     $this->assertEquals(serialize(array('something')), $savedReport->serializedData);
 }