Domain\Student\Http\StudentControllerTest::test_get_classrooms PHP Метод

test_get_classrooms() публичный Метод

public test_get_classrooms ( )
    public function test_get_classrooms()
    {
        $student = factory(Student::class)->create();
        $classrooms = factory(Classroom::class, 10)->create();
        $classrooms->each(function ($classroom) use($student) {
            $student->classrooms()->attach($classroom);
        });
        $this->get('api/v1/student/' . $student->id . '/classrooms');
        $response = json_decode($this->response->getContent(), true);
        $this->seeStatusCode(200);
        foreach ($classrooms as $classroom) {
            $this->seeJson(['id' => $classroom->id, 'name' => $classroom->name]);
        }
        foreach ($response as $classroom) {
            $this->assertFalse(isset($classroom['matters']));
        }
    }