Exemple #1
0
 protected function setUp()
 {
     $scaffolding = new Scaffolding(new Scaffolding\Adapter\Mongo());
     $scaffolding->setModelName('\\Vegas\\Tests\\Stub\\Models\\FakeModel');
     $scaffolding->setFormName('\\Vegas\\Tests\\Stub\\Models\\FakeForm');
     $this->scaffolding = $scaffolding;
     $record = new \Vegas\Tests\Stub\Models\FakeModel();
     $record->fake_field = 'test';
     $record->save();
     $this->record = $record;
 }
Exemple #2
0
 public function testShouldReturnValidPagination()
 {
     $mysql = new \Vegas\DI\Scaffolding\Adapter\Mysql();
     $scaffolding = new Scaffolding($mysql);
     $scaffolding->setModelName('\\Test\\Models\\Fake');
     $scaffolding->setFormName('\\Test\\Forms\\Fake');
     $scaffolding->doCreate(['fake_field' => 'fake']);
     $scaffolding->doCreate(['fake_field' => 'fake2']);
     $pagination = $mysql->getPaginator();
     $this->assertInstanceOf('\\Phalcon\\Paginator\\Adapter\\Model', $pagination);
     $this->assertInstanceOf('\\stdClass', $pagination->getPaginate());
 }