Bravo3\Orm\Tests\Services\CachingStrategyTest::testStrategy PHP Method

testStrategy() public method

public testStrategy ( Bravo3\Orm\Services\Cache\EntityCachingInterface $service )
$service Bravo3\Orm\Services\Cache\EntityCachingInterface
    public function testStrategy(EntityCachingInterface $service)
    {
        $product = new Product();
        $product->setId(1234);
        $this->assertFalse($service->exists(Product::class, 1234));
        $service->store(Product::class, '1234', $product);
        $this->assertTrue($service->exists(Product::class, 1234));
        $r = $service->retrieve(Product::class, '1234');
        $service->purge(Product::class, '1234');
        $this->assertFalse($service->exists(Product::class, 1234));
        $this->assertEquals(1234, $r->getId());
    }