mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge remote-tracking branch 'origin/2.0' into 2.1
This commit is contained in:
commit
b9ad469a65
5 changed files with 16 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
@charset "utf-8";
|
||||
/**
|
||||
*
|
||||
* Generic CSS for CakePHP
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@charset "utf-8";
|
||||
/**
|
||||
*
|
||||
* Generic CSS for CakePHP
|
||||
|
|
|
@ -1274,7 +1274,7 @@ class Model extends Object implements CakeEventListener {
|
|||
* @return array Array of table metadata
|
||||
*/
|
||||
public function schema($field = false) {
|
||||
if (!is_array($this->_schema) || $field === true) {
|
||||
if ($this->useTable !== false && (!is_array($this->_schema) || $field === true)) {
|
||||
$db = $this->getDataSource();
|
||||
$db->cacheSources = ($this->cacheSources && $db->cacheSources);
|
||||
if (method_exists($db, 'describe') && $this->useTable !== false) {
|
||||
|
|
|
@ -2319,4 +2319,16 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
$this->assertEquals(true, count($armorsPlayers) > 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that calling schema() on a model that is not supposed to use a table
|
||||
* does not trigger any calls on any datasource
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
public function testSchemaNoDB() {
|
||||
$model = $this->getMock('Article', array('getDataSource'));
|
||||
$model->useTable = false;
|
||||
$model->expects($this->never())->method('getDataSource');
|
||||
$this->assertEmpty($model->schema());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<li><code>pear channel-discover pear.symfony-project.com</code></li>
|
||||
<li><code>pear install phpunit/PHPUnit-3.6.4</code></li>
|
||||
</ul>
|
||||
<p>Once PHPUnit is installed make sure its located on PHP's <code>include_path</code> by checking your php.ini</p>
|
||||
<p>For full instructions on how to <a href="http://www.phpunit.de/manual/current/en/installation.html">install PHPUnit, see the PHPUnit installation guide</a>.</p>
|
||||
<p><a href="http://github.com/sebastianbergmann/phpunit" target="_blank">Download PHPUnit</a></p>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue