rename courses methood
This commit is contained in:
parent
8c6635ea0b
commit
42a303d16c
|
@ -230,7 +230,7 @@ class Api
|
||||||
/**
|
/**
|
||||||
* @return Collection<Course>
|
* @return Collection<Course>
|
||||||
*/
|
*/
|
||||||
public function coursesFor(int $memberId): Collection
|
public function coursesOf(int $memberId): Collection
|
||||||
{
|
{
|
||||||
$this->assertLoggedIn();
|
$this->assertLoggedIn();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class CourseTest extends TestCase
|
||||||
'vstgTag' => '2021-11-12 00:00:00',
|
'vstgTag' => '2021-11-12 00:00:00',
|
||||||
]));
|
]));
|
||||||
|
|
||||||
$course = $this->login()->coursesFor(11111)->first();
|
$course = $this->login()->coursesOf(11111)->first();
|
||||||
|
|
||||||
$this->assertEquals(788, $course->id);
|
$this->assertEquals(788, $course->id);
|
||||||
$this->assertEquals('KJA', $course->organizer);
|
$this->assertEquals('KJA', $course->organizer);
|
||||||
|
@ -44,7 +44,7 @@ class CourseTest extends TestCase
|
||||||
->shows(11111, Course::factory()->id(788)->toModel())
|
->shows(11111, Course::factory()->id(788)->toModel())
|
||||||
->shows(11111, Course::factory()->id(789)->toModel());
|
->shows(11111, Course::factory()->id(789)->toModel());
|
||||||
|
|
||||||
$courses = $this->login()->coursesFor(11111);
|
$courses = $this->login()->coursesOf(11111);
|
||||||
|
|
||||||
$this->assertCount(2, $courses);
|
$this->assertCount(2, $courses);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ class CourseTest extends TestCase
|
||||||
->failsShowingWithHtml(11111, 788)
|
->failsShowingWithHtml(11111, 788)
|
||||||
->shows(11111, Course::factory()->id(789)->toModel());
|
->shows(11111, Course::factory()->id(789)->toModel());
|
||||||
|
|
||||||
$courses = $this->login()->coursesFor(11111);
|
$courses = $this->login()->coursesOf(11111);
|
||||||
|
|
||||||
$this->assertCount(1, $courses);
|
$this->assertCount(1, $courses);
|
||||||
}
|
}
|
||||||
|
@ -66,14 +66,14 @@ class CourseTest extends TestCase
|
||||||
$this->expectException(NoJsonReceivedException::class);
|
$this->expectException(NoJsonReceivedException::class);
|
||||||
app(CourseFake::class)->failsFetchingWithHtml(11111);
|
app(CourseFake::class)->failsFetchingWithHtml(11111);
|
||||||
|
|
||||||
$this->login()->coursesFor(11111);
|
$this->login()->coursesOf(11111);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItNeedsLoginToGetCourses(): void
|
public function testItNeedsLoginToGetCourses(): void
|
||||||
{
|
{
|
||||||
$this->expectException(NotAuthenticatedException::class);
|
$this->expectException(NotAuthenticatedException::class);
|
||||||
|
|
||||||
Nami::coursesFor(11111);
|
Nami::coursesOf(11111);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testStoreACourse(): void
|
public function testStoreACourse(): void
|
||||||
|
@ -155,7 +155,7 @@ class CourseTest extends TestCase
|
||||||
{
|
{
|
||||||
$this->expectException(LoginException::class);
|
$this->expectException(LoginException::class);
|
||||||
|
|
||||||
$this->loginWithWrongCredentials()->coursesFor(11111);
|
$this->loginWithWrongCredentials()->coursesOf(11111);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testThrowExceptionWhenStoringFailed(): void
|
public function testThrowExceptionWhenStoringFailed(): void
|
||||||
|
|
Loading…
Reference in New Issue