public function setUp() { Annotations::setConfig(__DIR__ . '/../Mocks/MockAnnotationsConfig.yaml'); Rest::setConfig(__DIR__ . '/../Mocks/MockRestConfig.yaml'); // we need to create the cache files so we can test the router $parser = new Parser(); $parserApi = $parser->parseApi('Webiny\\Component\\Rest\\Tests\\Mocks\\MockApiClassRouter', true); self::$cache = new Cache(new ArrayDriver()); $instance = new Compiler('ExampleApi', true, self::$cache); $instance->writeCacheFiles($parserApi); }
public function testGetMethodAnnotations() { $annotations = Annotations::getMethodAnnotations('\\Webiny\\Component\\Annotations\\Tests\\TestClass', 'someMethod'); $this->assertNotNull($annotations->post); $this->assertNotNull($annotations->get); $this->assertNull($annotations->delete); $this->assertSame("10", $annotations->cache->ttl); $this->assertSame("true", $annotations->cache->store); $this->assertSame("cacheKey", $annotations->cache->key); $this->assertContains("json", $annotations->accept); $this->assertNotContains("csv", $annotations->accept); }
public function setUp() { Annotations::setConfig(__DIR__ . '/../Mocks/MockAnnotationsConfig.yaml'); Cache::setConfig(__DIR__ . '/../Mocks/MockCacheConfig.yaml'); Rest::setConfig(__DIR__ . '/../Mocks/MockRestConfig.yaml'); }
/** * Get the name of bridge library which will be used as the driver. * * @return string */ public static function getLibrary() { return \Webiny\Component\Annotations\Annotations::getConfig()->get('Bridge', self::$library); }
public function setUp() { Annotations::setConfig(__DIR__ . '/ExampleConfig.yaml'); }