/** * @test * @group Assert * @dataProvider matchingKeysProvider */ public function matching_keys_do_not_trigger_an_exception($givenArray, $expectedKeys) { $exceptionIsThrown = false; try { Assert::keysAre($givenArray, $expectedKeys); } catch (AssertionFailedException $e) { $exceptionIsThrown = true; } $this->assertFalse($exceptionIsThrown); }
/** * @param TranslatorInterface $translator * @param array $locales * @param array $helpUrls * @param array $platformUrls * @param array $termsOfServiceUrls * @param array $profileExplanationImageUrls * @param array $attributeInformationUrls */ public function __construct(TranslatorInterface $translator, array $locales, array $helpUrls, array $platformUrls, array $termsOfServiceUrls, array $profileExplanationImageUrls, array $attributeInformationUrls) { Assert::keysAre($helpUrls, $locales); Assert::keysAre($platformUrls, $locales); Assert::keysAre($termsOfServiceUrls, $locales); Assert::keysAre($profileExplanationImageUrls, $locales); Assert::keysAre($attributeInformationUrls, $locales); $this->translator = $translator; $this->helpUrls = $helpUrls; $this->platformUrls = $platformUrls; $this->termsOfServiceUrls = $termsOfServiceUrls; $this->profileExplanationImageUrls = $profileExplanationImageUrls; $this->attributeInformationUrls = $attributeInformationUrls; }