From 83add78952e6ab790477310b60cf9f36dfd0dfcb Mon Sep 17 00:00:00 2001 From: antograssiot Date: Sat, 20 Aug 2016 07:23:13 +0200 Subject: [PATCH] remove specific php5.5 code --- src/Network/Socket.php | 10 ++-------- tests/TestCase/Database/Driver/SqliteTest.php | 6 +----- tests/TestCase/Database/Schema/MysqlSchemaTest.php | 6 +----- tests/TestCase/Database/Schema/PostgresSchemaTest.php | 6 +----- tests/TestCase/Database/Schema/SqliteSchemaTest.php | 6 +----- tests/TestCase/Database/Schema/SqlserverSchemaTest.php | 6 +----- tests/TestCase/Event/EventManagerTest.php | 9 --------- 7 files changed, 7 insertions(+), 42 deletions(-) diff --git a/src/Network/Socket.php b/src/Network/Socket.php index 2b379491381..6d6b42bea2a 100644 --- a/src/Network/Socket.php +++ b/src/Network/Socket.php @@ -198,14 +198,8 @@ protected function _setSslContext($host) if (!isset($this->_config['context']['ssl']['SNI_enabled'])) { $this->_config['context']['ssl']['SNI_enabled'] = true; } - if (version_compare(PHP_VERSION, '5.6.0', '>=')) { - if (empty($this->_config['context']['ssl']['peer_name'])) { - $this->_config['context']['ssl']['peer_name'] = $host; - } - } else { - if (empty($this->_config['context']['ssl']['SNI_server_name'])) { - $this->_config['context']['ssl']['SNI_server_name'] = $host; - } + if (empty($this->_config['context']['ssl']['peer_name'])) { + $this->_config['context']['ssl']['peer_name'] = $host; } if (empty($this->_config['context']['ssl']['cafile'])) { $dir = dirname(dirname(__DIR__)); diff --git a/tests/TestCase/Database/Driver/SqliteTest.php b/tests/TestCase/Database/Driver/SqliteTest.php index bfeb474887c..a02a324e245 100644 --- a/tests/TestCase/Database/Driver/SqliteTest.php +++ b/tests/TestCase/Database/Driver/SqliteTest.php @@ -127,11 +127,7 @@ public static function schemaValueProvider() public function testSchemaValue($input, $expected) { $driver = new Sqlite(); - $pdo = PDO::class; - if (version_compare(PHP_VERSION, '5.6', '<')) { - $pdo = 'FakePdo'; - } - $mock = $this->getMockBuilder($pdo) + $mock = $this->getMockBuilder(PDO::class) ->setMethods(['quote', 'quoteIdentifier']) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/TestCase/Database/Schema/MysqlSchemaTest.php b/tests/TestCase/Database/Schema/MysqlSchemaTest.php index e4c9372ac8d..3eeac8e8617 100644 --- a/tests/TestCase/Database/Schema/MysqlSchemaTest.php +++ b/tests/TestCase/Database/Schema/MysqlSchemaTest.php @@ -1231,11 +1231,7 @@ public function testDescribeJson() protected function _getMockedDriver() { $driver = new Mysql(); - $pdo = PDO::class; - if (version_compare(PHP_VERSION, '5.6', '<')) { - $pdo = 'FakePdo'; - } - $mock = $this->getMockBuilder($pdo) + $mock = $this->getMockBuilder(PDO::class) ->setMethods(['quote', 'quoteIdentifier', 'getAttribute']) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/TestCase/Database/Schema/PostgresSchemaTest.php b/tests/TestCase/Database/Schema/PostgresSchemaTest.php index f00617407e5..830e6716603 100644 --- a/tests/TestCase/Database/Schema/PostgresSchemaTest.php +++ b/tests/TestCase/Database/Schema/PostgresSchemaTest.php @@ -1199,11 +1199,7 @@ public function testTruncateSql() protected function _getMockedDriver() { $driver = new Postgres(); - $pdo = PDO::class; - if (version_compare(PHP_VERSION, '5.6', '<')) { - $pdo = 'FakePdo'; - } - $mock = $this->getMockBuilder($pdo) + $mock = $this->getMockBuilder(PDO::class) ->setMethods(['quote']) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/TestCase/Database/Schema/SqliteSchemaTest.php b/tests/TestCase/Database/Schema/SqliteSchemaTest.php index 72f304830a7..f537ff2a00f 100644 --- a/tests/TestCase/Database/Schema/SqliteSchemaTest.php +++ b/tests/TestCase/Database/Schema/SqliteSchemaTest.php @@ -1032,11 +1032,7 @@ public function testTruncateSqlNoSequences() protected function _getMockedDriver() { $driver = new Sqlite(); - $pdo = PDO::class; - if (version_compare(PHP_VERSION, '5.6', '<')) { - $pdo = 'FakePdo'; - } - $mock = $this->getMockBuilder($pdo) + $mock = $this->getMockBuilder(PDO::class) ->setMethods(['quote', 'prepare']) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/TestCase/Database/Schema/SqlserverSchemaTest.php b/tests/TestCase/Database/Schema/SqlserverSchemaTest.php index 82bdccf784e..743172262b4 100644 --- a/tests/TestCase/Database/Schema/SqlserverSchemaTest.php +++ b/tests/TestCase/Database/Schema/SqlserverSchemaTest.php @@ -952,11 +952,7 @@ public function testTruncateSql() protected function _getMockedDriver() { $driver = new Sqlserver(); - $pdo = PDO::class; - if (version_compare(PHP_VERSION, '5.6', '<')) { - $pdo = 'FakePdo'; - } - $mock = $this->getMockBuilder($pdo) + $mock = $this->getMockBuilder(PDO::class) ->setMethods(['quote']) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/TestCase/Event/EventManagerTest.php b/tests/TestCase/Event/EventManagerTest.php index 9e23309a89b..17f012a2dc4 100644 --- a/tests/TestCase/Event/EventManagerTest.php +++ b/tests/TestCase/Event/EventManagerTest.php @@ -405,10 +405,6 @@ public function testDispatchWithKeyName() */ public function testDispatchReturnValue() { - $this->skipIf( - version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<'), - 'These tests fail in PHPUnit 3.6' - ); $manager = new EventManager; $listener = $this->getMockBuilder(__NAMESPACE__ . '\EventTestListener') ->getMock(); @@ -436,11 +432,6 @@ public function testDispatchReturnValue() */ public function testDispatchFalseStopsEvent() { - $this->skipIf( - version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<'), - 'These tests fail in PHPUnit 3.6' - ); - $manager = new EventManager(); $listener = $this->getMockBuilder(__NAMESPACE__ . '\EventTestListener') ->getMock();