diff --git a/src/Scanner.php b/src/Scanner.php index c78e5a1..dc1ddf3 100644 --- a/src/Scanner.php +++ b/src/Scanner.php @@ -41,7 +41,7 @@ public function findTranslations() '('. // Start a new group to match: '.+'. // Must start with group ')'. // Close group - "[\'\"]". // Closing quote + "(?scanner = app()->make(Scanner::class); $matches = $this->scanner->findTranslations(); - $this->assertEquals(['single' => ['single' => ['This will go in the JSON array' => '', 'This will also go in the JSON array' => '', 'This will go in the JSON array, and it\'ll properly unescape the apostrophe.' => '', 'trans' => '']], 'group' => ['lang' => ['first_match' => ''], 'lang_get' => ['first' => '', 'second' => ''], 'trans' => ['first_match' => '', 'third_match' => ''], 'trans_choice' => ['with_params' => '']]], $matches); + $this->assertEquals(['single' => ['single' => ['This will go in the JSON array' => '', 'This will also go in the JSON array' => '', 'This will go in the JSON array, and it\'ll properly unescape the apostrophe.' => '', 'The first half of this sentence should go into the \'JSON array\', but the second part should as well!' => '', 'trans' => '']], 'group' => ['lang' => ['first_match' => ''], 'lang_get' => ['first' => '', 'second' => ''], 'trans' => ['first_match' => '', 'third_match' => ''], 'trans_choice' => ['with_params' => '']]], $matches); $this->assertCount(2, $matches); } } diff --git a/tests/fixtures/scan-tests/__.txt b/tests/fixtures/scan-tests/__.txt index 27cb283..0a0cc47 100644 --- a/tests/fixtures/scan-tests/__.txt +++ b/tests/fixtures/scan-tests/__.txt @@ -5,4 +5,6 @@ __( 'This will also go in the JSON array' ) -__('This will go in the JSON array, and it\'ll properly unescape the apostrophe.') \ No newline at end of file +__('This will go in the JSON array, and it\'ll properly unescape the apostrophe.') + +__('The first half of this sentence should go into the \'JSON array\', but the second part should as well!')