/** * Check if the `exists` method return false if a key isn't cached. */ public function testExistsReturnFalse() { $key = new HashKey(Hash::ALGO_SHA1, 'php://temp/'); $container = new TempResourceContainer(TempFileResource::TYPE); $adapter = new ResourceAdapter($container); $this->assertFalse($adapter->exists($key)); }
/** * Test if can store an annotation list. */ public function testStoreAnnotationList() { /* @var \com\mohiva\common\lang\AnnotationReflector $class */ $class = new ReflectionClass(self::TEST_CLASS); $docReflector = new ReflectionDocComment($class); $annotationList = $docReflector->getAnnotationList(); $key = new HashKey(Hash::ALGO_SHA1, 'php://temp'); $adapter = new ResourceAdapter(new TempResourceContainer(TempFileResource::TYPE)); $container = new AnnotationContainer($adapter, $key); $container->store($class->getDocComment(), $annotationList); $this->assertTrue($adapter->exists($key)); }