From ac43c4701645ce22d52e4cbe4d6e382abcafb7d8 Mon Sep 17 00:00:00 2001 From: Mark van den Broek Date: Sat, 24 Aug 2019 13:32:18 +0200 Subject: [PATCH] Adds additional test. --- tests/GtinValidationTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/GtinValidationTest.php b/tests/GtinValidationTest.php index c778362..ead4f48 100644 --- a/tests/GtinValidationTest.php +++ b/tests/GtinValidationTest.php @@ -2,6 +2,8 @@ namespace Mvdnbrk\Gtin\Tests; +use Illuminate\Support\Facades\App; + class GtinValidationTest extends TestCase { /** @@ -188,6 +190,22 @@ public function it_returns_the_correct_error_message() ); } + /** @test */ + public function it_returns_the_correct_translated_error_message() + { + App::setLocale('nl'); + + $validation = $this->validator->make( + ['field' => 'invalid-gtin'], + ['field' => 'gtin'] + ); + + $this->assertEquals( + 'Het veld field moet een geldig Global Trade Item Number (GTIN) zijn.', + $validation->errors()->first('field') + ); + } + /** @test */ public function it_has_a_helper_function() {