From 1d0333026f33e0ec059ad704915a2cdb04c2286f Mon Sep 17 00:00:00 2001 From: David Naber Date: Tue, 11 Aug 2020 09:41:29 +0200 Subject: [PATCH] Add Test for ApplicationContextRepository PCP-28 Add new parameter to ::currentContext() --- .../Repository/ApplicationContextRepositoryTest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/PHPUnit/WcGateway/Repository/ApplicationContextRepositoryTest.php b/tests/PHPUnit/WcGateway/Repository/ApplicationContextRepositoryTest.php index 91921c5af..0834f83f1 100644 --- a/tests/PHPUnit/WcGateway/Repository/ApplicationContextRepositoryTest.php +++ b/tests/PHPUnit/WcGateway/Repository/ApplicationContextRepositoryTest.php @@ -18,7 +18,12 @@ class ApplicationContextRepositoryTest extends TestCase /** * @dataProvider currentContextData */ - public function testCurrentContext(array $container, string $userLocale, array $expected): void + public function testCurrentContext( + array $container, + string $userLocale, + string $shippingPreference, + array $expected + ): void { $brandName = 'Acme Corp.'; @@ -38,7 +43,7 @@ class ApplicationContextRepositoryTest extends TestCase /* @var ApplicationContextRepository $testee */ $testee = $this->buildTestee()[1]; - $context = $testee->currentContext(); + $context = $testee->currentContext($shippingPreference); self::assertInstanceOf( ApplicationContext::class, @@ -66,10 +71,12 @@ class ApplicationContextRepositoryTest extends TestCase 'landing_page' => ApplicationContext::LANDING_PAGE_BILLING, ], 'user_locale' => 'de_DE', + 'shippingPreference' => ApplicationContext::SHIPPING_PREFERENCE_NO_SHIPPING, 'expected' => [ 'locale' => 'de-DE', 'brandName' => 'Acme corp.', - 'landingPage' => ApplicationContext::LANDING_PAGE_BILLING, + 'landingPage' => ApplicationContext::LANDING_PAGE_BILLING, + 'shippingPreference' => ApplicationContext::SHIPPING_PREFERENCE_NO_SHIPPING, ], ], ];