From 74cde415cfa48d318105b301df9c516da0857e9e Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 17 Jul 2020 15:54:59 +0400 Subject: Added program entity Signed-off-by: Valentin Popov --- tests/Entities/ProgramEntityTest.php | 83 ++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 tests/Entities/ProgramEntityTest.php (limited to 'tests') diff --git a/tests/Entities/ProgramEntityTest.php b/tests/Entities/ProgramEntityTest.php new file mode 100644 index 0000000..c36e283 --- /dev/null +++ b/tests/Entities/ProgramEntityTest.php @@ -0,0 +1,83 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 + * @package Tests\Entities + */ +final class ProgramEntityTest extends TestCase { + public function testCreateEntity(): void { + $faker = Faker::create(); + + $categories = [$faker->unique()->sha256]; + $channel_id = $faker->unique()->sha256; + $countries = [$faker->unique()->sha256]; + $credits = [GetCreditEntityUtility::get()]; + $date = $faker->unique()->dateTime; + $description = $faker->unique()->sha256; + $icons = [$faker->unique()->sha256]; + $parents_guide = $faker->unique()->sha256; + $productions = [$faker->unique()->sha256]; + $start = $faker->unique()->dateTime; + $stop = $faker->unique()->dateTime; + $sub_title = $faker->unique()->sha256; + $title = $faker->unique()->sha256; + $year = $faker->unique()->sha256; + + $entity = ProgramEntity::create(compact( + 'categories', + 'channel_id', + 'countries', + 'credits', + 'date', + 'description', + 'icons', + 'parents_guide', + 'productions', + 'start', + 'stop', + 'sub_title', + 'title', + 'year' + )); + + self::assertEquals($categories, $entity->categories); + self::assertEquals($channel_id, $entity->channel_id); + self::assertEquals($countries[0], $entity->countries[0]); + self::assertEquals($credits[0]->name, $entity->credits[0]->name); + self::assertEquals($date->getTimestamp(), $entity->date->getTimestamp()); + self::assertEquals($description, $entity->description); + self::assertEquals($icons[0], $entity->icons[0]); + self::assertEquals($parents_guide, $entity->parents_guide); + self::assertEquals($productions[0], $entity->productions[0]); + self::assertEquals($start->getTimestamp(), $entity->start->getTimestamp()); + self::assertEquals($stop->getTimestamp(), $entity->stop->getTimestamp()); + self::assertEquals($sub_title, $entity->sub_title); + self::assertEquals($title, $entity->title); + self::assertEquals($year, $entity->year); + } +} -- cgit v1.2.3