Пример #1
0
 public function testFetchAllPosts()
 {
     $samples = 5;
     $postIds = [];
     for ($i = 0; $i < $samples; $i++) {
         $postIds[] = static::insertSamplePost();
     }
     $posts = Post::all();
     $this->assertCount($samples, $posts);
     foreach ($posts as $post) {
         $this->assertInstanceOf(Post::class, $post);
     }
 }
Пример #2
0
 public static function getAppendContent(Post $object)
 {
     if (!empty($object->toArray())) {
         $fields = collect($object->toArray());
         return self::generateContentFromArray($fields);
     }
 }