AssetManagerTest\Service\AssetManagerTest::testSetExtensionFiltersNotDuplicate PHP Method

testSetExtensionFiltersNotDuplicate() public method

    public function testSetExtensionFiltersNotDuplicate()
    {
        $config = array('filters' => array('js' => array(array('filter' => '\\ReverseFilter'))));
        $resolver = $this->getCollectionResolver();
        $assetFilterManager = new AssetFilterManager($config['filters']);
        $mimeResolver = new MimeResolver();
        $assetFilterManager->setMimeResolver($mimeResolver);
        $resolver->setAssetFilterManager($assetFilterManager);
        $response = new Response();
        $request = $this->getRequest();
        // Have to change uri because asset-path would cause an infinite loop
        $request->setUri('http://localhost/base-path/blah.js');
        $assetCacheManager = $this->getAssetCacheManagerMock();
        $assetManager = new AssetManager($resolver->getAggregateResolver(), $config);
        $assetManager->setAssetCacheManager($assetCacheManager);
        $assetManager->setAssetFilterManager($assetFilterManager);
        $this->assertTrue($assetManager->resolvesToAsset($request));
        $assetManager->setAssetOnResponse($response);
        $reversedOnlyOnce = '1' . strrev(file_get_contents(__DIR__ . '/../../_files/require-jquery.js'));
        $this->assertEquals($reversedOnlyOnce, $response->getBody());
    }