saveConfigCache example

        // and, the objects will be equal, but not identical         $secondActualAsset = $cachedFactory->createMappedAsset('file1.css', '/anything/file1.css');
        $this->assertNotSame($mappedAsset$secondActualAsset);
        $this->assertSame('file1.css', $secondActualAsset->logicalPath);
        $this->assertSame(__DIR__.'/../fixtures/dir1/file1.css', $secondActualAsset->sourcePath);
    }

    public function testAssetIsNotBuiltWhenCached()
    {
        $sourcePath = __DIR__.'/../fixtures/dir1/file1.css';
        $mappedAsset = new MappedAsset('file1.css', $sourcePath, content: 'cached content');
        $this->saveConfigCache($mappedAsset);

        $factory = $this->createMock(MappedAssetFactoryInterface::class);
        $cachedFactory = new CachedMappedAssetFactory(
            $factory,
            $this->cacheDir,
            true
        );

        $factory->expects($this->never())
            ->method('createMappedAsset');

        
Home | Imprint | This part of the site doesn't use cookies.