public function testSimpleFirst()
 {
     //$this->app['db']->connection()->getSchemaBuilder()->getColumnListing('contents');
     $model = $this->content->create(['enable' => 1]);
     $this->assertFalse($this->checkerAttribute->check($model, 'name'));
     $this->assertTrue($this->checkerAttribute->check($model, 'id'));
     $this->assertfalse($this->checkerAttribute->check($model, 'notexist'));
     $this->assertTrue($this->checkerAttribute->check($model, 'visible'));
     $this->assertTrue($this->checkerAttribute->check($model, 'created_at'));
 }
 public function createContent($n)
 {
     for ($i = 0; $i < $n; $i++) {
         Content::create(['enable' => '1', 'visible' => 2])->save();
     }
     return Content::all()->count() === $n;
 }
Example #3
0
 public function createContentWithLanguages()
 {
     for ($i = 1; $i < 6; $i++) {
         Content::create(['visible' => 1, 'enable' => 1]);
     }
     foreach (Content::all() as $v) {
         for ($i = 1; $i < 11; $i++) {
             $v->langModels()->create(['content' => str_random(), 'title' => str_random(), '__lang_id__' => $i]);
         }
     }
 }