/** * {@inheritDoc} * */ public function describe($name, array $options = []) { $options += ['forceRefresh' => false]; $cacheConfig = $this->cacheMetadata(); $cacheKey = $this->cacheKey($name); if (!empty($cacheConfig) && !$options['forceRefresh']) { $cached = Cache::read($cacheKey, $cacheConfig); if ($cached !== false) { return $cached; } } $method = parent::describe($name, $options); if (!empty($cacheConfig)) { Cache::write($cacheKey, $method, $cacheConfig); } return $method; }
/** * Test that describing non-existent tables fails. * * Tests for positive describe() calls are in each platformSchema * test case. * * @expectedException \Cake\Database\Exception * @return void */ public function testDescribeIncorrectMethod() { $schema = new MethodsCollection($this->connection); $this->assertNull($schema->describe('CALC.SUM333')); }