Skip to content
Permalink
Browse files

Fix some count() Error in PHP 7.2

  • Loading branch information...
tenkoma committed Jan 16, 2018
1 parent f4315d8 commit aa14c684978a977484e94ce3c6029c6ad2c3ff60
@@ -328,7 +328,7 @@ public function bakeActions($controllerName, $admin = null, $wannaUseSession = t
* @param array $components Components to use in controller
* @return string Baked controller
*/
public function bake($controllerName, $actions = '', $helpers = null, $components = null) {
public function bake($controllerName, $actions = '', $helpers = array(), $components = array()) {
$this->out("\n" . __d('cake_console', 'Baking controller class for %s...', $controllerName), 1, Shell::QUIET);
$isScaffold = ($actions === 'scaffold') ? true : false;
@@ -64,7 +64,7 @@ public function testGetDataSource() {
ConnectionManager::create($name, $config);
$connections = ConnectionManager::enumConnectionObjects();
$this->assertTrue((bool)(count(array_keys($connections) >= 1)));
$this->assertTrue(count(array_keys($connections)) >= 1);
$source = ConnectionManager::getDataSource('test_get_datasource');
$this->assertTrue(is_object($source));
@@ -239,7 +239,7 @@ public function testCreateDataSourceWithIntegrationTests() {
$name = 'test_created_connection';
$connections = ConnectionManager::enumConnectionObjects();
$this->assertTrue((bool)(count(array_keys($connections) >= 1)));
$this->assertTrue(count(array_keys($connections)) >= 1);
$source = ConnectionManager::getDataSource('test');
$this->assertTrue(is_object($source));
@@ -3367,7 +3367,9 @@ public function testSaveAllHabtm() {
array(
'comment' => 'Article comment',
'user_id' => 1
)));
)
)
);
$Article = new Article();
$result = $Article->saveAll($data);
$this->assertFalse(empty($result));
@@ -3376,7 +3378,7 @@ public function testSaveAllHabtm() {
$this->assertEquals(2, count($result['Tag']));
$this->assertEquals('tag1', $result['Tag'][0]['tag']);
$this->assertEquals(1, count($result['Comment']));
$this->assertEquals(1, count($result['Comment'][0]['comment']));
$this->assertEquals('Article comment', $result['Comment'][0]['comment']);
}
/**
@@ -5647,7 +5649,9 @@ public function testSaveAssociatedHabtm() {
array(
'comment' => 'Article comment',
'user_id' => 1
)));
)
)
);
$Article = new Article();
$result = $Article->saveAssociated($data);
$this->assertFalse(empty($result));
@@ -5656,7 +5660,7 @@ public function testSaveAssociatedHabtm() {
$this->assertEquals(2, count($result['Tag']));
$this->assertEquals('tag1', $result['Tag'][0]['tag']);
$this->assertEquals(1, count($result['Comment']));
$this->assertEquals(1, count($result['Comment'][0]['comment']));
$this->assertEquals('Article comment', $result['Comment'][0]['comment']);
}
/**

0 comments on commit aa14c68

Please sign in to comment.
You can’t perform that action at this time.