Symfony\Bundle\AsseticBundle\Tests\Factory\AssetFactoryTest::testBundleGlobNotation PHP Метод

testBundleGlobNotation() публичный Метод

public testBundleGlobNotation ( $input )
    public function testBundleGlobNotation($input)
    {
        $bundle = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface')->getMock();
        $this->parameterBag->expects($this->once())->method('resolveValue')->will($this->returnCallback(function ($v) {
            return $v;
        }));
        $this->kernel->expects($this->once())->method('getBundle')->with('MyBundle')->will($this->returnValue($bundle));
        $this->kernel->expects($this->once())->method('locateResource')->with('@MyBundle/Resources/css/')->will($this->returnValue('/path/to/MyBundle/Resources/css/'));
        $bundle->expects($this->once())->method('getPath')->will($this->returnValue('/path/to/MyBundle'));
        $coll = $this->factory->createAsset($input)->all();
        $asset = $coll[0];
        $this->assertEquals('/path/to/MyBundle', $asset->getSourceRoot(), '->createAsset() sets the asset root');
        $this->assertNull($asset->getSourcePath(), '->createAsset() sets the asset path to null');
    }