Skip to content

Commit

Permalink
remove specific php5.5 code
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Aug 20, 2016
1 parent b38262c commit 83add78
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 42 deletions.
10 changes: 2 additions & 8 deletions src/Network/Socket.php
Expand Up @@ -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__));
Expand Down
6 changes: 1 addition & 5 deletions tests/TestCase/Database/Driver/SqliteTest.php
Expand Up @@ -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();
Expand Down
6 changes: 1 addition & 5 deletions tests/TestCase/Database/Schema/MysqlSchemaTest.php
Expand Up @@ -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();
Expand Down
6 changes: 1 addition & 5 deletions tests/TestCase/Database/Schema/PostgresSchemaTest.php
Expand Up @@ -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();
Expand Down
6 changes: 1 addition & 5 deletions tests/TestCase/Database/Schema/SqliteSchemaTest.php
Expand Up @@ -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();
Expand Down
6 changes: 1 addition & 5 deletions tests/TestCase/Database/Schema/SqlserverSchemaTest.php
Expand Up @@ -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();
Expand Down
9 changes: 0 additions & 9 deletions tests/TestCase/Event/EventManagerTest.php
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 83add78

Please sign in to comment.