public function testTopicMove() { $fake = Factory::create(); $topic = $this->create(); $this->assertEquals(1, $this->tester->grabRecord('forums', ['id' => $this->forum->id])->topics); $newForum = Forum::create(['name' => $fake->name, 'path' => $fake->name, 'description' => 'Lorem ipsum']); $topic->forum_id = $newForum->id; $topic->save(); $this->assertEquals(1, $this->tester->grabRecord('forums', ['id' => $newForum->id])->topics); $this->tester->dontSeeRecord('posts', ['forum_id' => $this->forum->id]); }
private function create() { Forum::create(['name' => 'A', 'path' => 'A', 'description' => 'Lorem ipsum']); Forum::create(['name' => 'B', 'path' => 'B', 'description' => 'Lorem ipsum']); }