<?php

class LocalizationScriptTest extends TestCase
{
    public function testScriptRetrieval()
    {
        $response = $this->call('GET', '/js-localization/localization.js');

        $this->assertTrue($response->isOk());

        $content = $response->getContent();
        $this->assertRegExp('/^\(function\(.*\);/', $content);
    }
}
<?php

class LocalizationScriptTest extends TestCase
{
    public function testScriptRetrieval()
    {
        $response = $this->call('GET', '/js-localization/localization.js');

        $this->assertTrue($response->isOk());
        $content = $response->getContent();
        
        // Test for JS content
        
        $this->assertRegExp('/^\(function\(.*\);/', $content);
    }
    
    public function testScriptAndTranslationCombinedRetrieval()
    {
        $response = $this->call('GET', '/js-localization/all.js');

        $this->assertTrue($response->isOk());
        $content = $response->getContent();

        // Test for JS content

        $this->assertRegExp('/^\(function\(.*\);/', $content);

        // Test for Lang.setLocale()

        $locale = \Illuminate\Support\Facades\Lang::locale();
        $this->assertRegExp('/Lang\.setLocale\("'.$locale.'"\);/', $content);
        
        // Test for Land.addMessages()

        $addMessagesRegex = '/Lang\.addMessages\( (\{.*?\}) \);/x';
        $this->assertRegExp($addMessagesRegex, $content);
    }
}
Add test for all.js request
Add test for all.js request
