From 3f5321af9d6d48e1e50d6041548abfb74e594de0 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 22 Sep 2024 12:27:26 +0200 Subject: [PATCH] Fix tests --- tests/Unit/CourseFactoryTest.php | 2 +- tests/Unit/CourseTest.php | 10 ++++------ tests/Unit/MemberFactoryTest.php | 2 +- tests/Unit/MembershipEntryFactoryTest.php | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/Unit/CourseFactoryTest.php b/tests/Unit/CourseFactoryTest.php index de89988..864cb50 100644 --- a/tests/Unit/CourseFactoryTest.php +++ b/tests/Unit/CourseFactoryTest.php @@ -11,7 +11,7 @@ class CourseFactoryTest extends TestCase { public function testItCanRenderACourseAsJson(): void { - $course = Course::factory()->toCourse(); + $course = Course::toFactory()->toCourse(); $json = $course->toArray(); $data = json_decode(json_encode($json)); diff --git a/tests/Unit/CourseTest.php b/tests/Unit/CourseTest.php index d856feb..ccf6d4c 100644 --- a/tests/Unit/CourseTest.php +++ b/tests/Unit/CourseTest.php @@ -4,11 +4,9 @@ namespace Zoomyboy\LaravelNami\Tests\Unit; use Zoomyboy\LaravelNami\Data\Course; use Zoomyboy\LaravelNami\Exceptions\NoJsonReceivedException; -use Zoomyboy\LaravelNami\Exceptions\NotAuthenticatedException; use Zoomyboy\LaravelNami\Exceptions\NotSuccessfulException; use Zoomyboy\LaravelNami\Fakes\CourseFake; use Zoomyboy\LaravelNami\LoginException; -use Zoomyboy\LaravelNami\Nami; use Zoomyboy\LaravelNami\Tests\TestCase; class CourseTest extends TestCase @@ -17,7 +15,7 @@ class CourseTest extends TestCase { app(CourseFake::class) ->fetches(11111, [788]) - ->shows(11111, Course::factory()->toCourse([ + ->shows(11111, Course::toFactory()->toCourse([ 'bausteinId' => 506, 'id' => 788, 'veranstalter' => 'KJA', @@ -41,8 +39,8 @@ class CourseTest extends TestCase { app(CourseFake::class) ->fetches(11111, [788, 789]) - ->shows(11111, Course::factory()->id(788)->toCourse()) - ->shows(11111, Course::factory()->id(789)->toCourse()); + ->shows(11111, Course::toFactory()->id(788)->toCourse()) + ->shows(11111, Course::toFactory()->id(789)->toCourse()); $courses = $this->login()->coursesOf(11111); @@ -54,7 +52,7 @@ class CourseTest extends TestCase app(CourseFake::class) ->fetches(11111, [788, 789]) ->failsShowingWithHtml(11111, 788) - ->shows(11111, Course::factory()->id(789)->toCourse()); + ->shows(11111, Course::toFactory()->id(789)->toCourse()); $courses = $this->login()->coursesOf(11111); diff --git a/tests/Unit/MemberFactoryTest.php b/tests/Unit/MemberFactoryTest.php index 5042d47..87861db 100644 --- a/tests/Unit/MemberFactoryTest.php +++ b/tests/Unit/MemberFactoryTest.php @@ -11,7 +11,7 @@ class MemberFactoryTest extends TestCase { public function testItCanRenderMemberAsJson(): void { - $member = Member::factory()->toMember(); + $member = Member::toFactory()->toMember(); $json = $member->toArray(); $data = json_decode(json_encode($json)); diff --git a/tests/Unit/MembershipEntryFactoryTest.php b/tests/Unit/MembershipEntryFactoryTest.php index 922156f..ea5d52a 100644 --- a/tests/Unit/MembershipEntryFactoryTest.php +++ b/tests/Unit/MembershipEntryFactoryTest.php @@ -11,7 +11,7 @@ class MembershipEntryFactoryTest extends TestCase { public function testItCanRenderACourseAsJson(): void { - $membership = MembershipEntry::factory()->toMembership(); + $membership = MembershipEntry::toFactory()->toMembership(); $json = $membership->toArray(); $data = json_decode(json_encode($json));