コード例 #1
0
 /**
  * Test if the `current` method returns the current resource.
  */
 public function testCurrentReturnCurrentResource()
 {
     $container = new TempResourceContainer(TempFileResource::TYPE);
     $container->create('php://temp/test', 'test');
     $container->rewind();
     $expected = $container->get('php://temp/test');
     $actual = $container->current();
     $this->assertSame($expected->getHandle()->getPathname(), $actual->getHandle()->getPathname());
 }
コード例 #2
0
ファイル: ResourceAdapterTest.php プロジェクト: mohiva/common
 /**
  * Test if the `store` method stores a value.
  */
 public function testStoreValueInCache()
 {
     $value = 'A value';
     $key = new HashKey(Hash::ALGO_SHA1, 'php://temp/');
     $container = new TempResourceContainer(TempFileResource::TYPE);
     $adapter = new ResourceAdapter($container);
     $adapter->store($key, $value);
     $this->assertSame($value, $container->get((string) $key)->read());
 }