diff --git a/src/Organization.php b/src/Organization.php index 0660bd4..7168d50 100644 --- a/src/Organization.php +++ b/src/Organization.php @@ -71,7 +71,7 @@ public function format(bool $separator = true): string */ public function valid(): bool { - if (!preg_match("/^\d{6}[\-\/]?\d{4}+$/", $this->orgNo)) { + if (!preg_match('/^\d{6}-?\d{4}$/', $this->orgNo)) { return false; } diff --git a/tests/SwedishEntityTest.php b/tests/SwedishEntityTest.php index a69010b..4f2d4d7 100644 --- a/tests/SwedishEntityTest.php +++ b/tests/SwedishEntityTest.php @@ -133,6 +133,7 @@ public function testInvalidCompanies() $this->assertFalse((new Organization('556016-0681'))->valid()); $this->assertFalse((new Organization('556103-4250'))->valid()); $this->assertFalse((new Organization('5561034250'))->valid()); + $this->assertFalse((new Organization('556103/4250'))->valid()); } /** @test */