TestStorage example


      }
    }
  }

  /** * Tests replaceStorageContents() with config with an invalid configuration. * * @covers ::replaceStorageContents */
  public function testWithInvalidConfiguration() {
    $source = new TestStorage();
    $this->generateRandomData($source);

    // Get a name from the source config storage and set the config value to     // false. It mimics a config storage read return value when that config     // storage has an invalid configuration.     $names = $source->listAll();
    $test_name = reset($names);
    $source->setValue($test_name, FALSE);

    $logger_factory = $this->prophesize(LoggerChannelFactoryInterface::class);
    $container = new ContainerBuilder();
    
use PHPUnit\Framework\TestCase;
use Symfony\Component\Templating\Tests\Fixtures\TestStorage;

/** * @group legacy */
class StorageTest extends TestCase
{
    public function testMagicToString()
    {
        $storage = new TestStorage('foo');
        $this->assertEquals('foo', (string) $storage, '__toString() returns the template name');
    }
}
Home | Imprint | This part of the site doesn't use cookies.