Skip to content

Commit

Permalink
Merge bb0b6fb into 0632ead
Browse files Browse the repository at this point in the history
  • Loading branch information
zonuexe committed Feb 14, 2020
2 parents 0632ead + bb0b6fb commit 94874d8
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -4,6 +4,8 @@ php:
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- nightly

matrix:
Expand All @@ -16,6 +18,7 @@ matrix:
dist: trusty
allow_failures:
- php: nightly
- php: hhvm-3.30

sudo: false
cache:
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Expand Up @@ -4,8 +4,11 @@
"version": "0.0.5",
"keywords": ["register_globals", "magic_quotes_gpc"],
"homepage": "https://github.com/gongo/merciful-polluter",
"require": {
"php": ">=5.4"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^7.5 || ^4.8",
"php-coveralls/php-coveralls": "*"
},
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions test/BaseTest.php
@@ -1,7 +1,7 @@
<?php
namespace Gongo\MercifulPolluter\Test;

use \PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use Gongo\MercifulPolluter\Base;

class Polluter extends Base
Expand All @@ -12,10 +12,10 @@ public function check($theKey)
}
}

class BaseTest extends PHPUnit_Framework_TestCase
class BaseTest extends TestCase
{
private $object = null;

protected function setUp()
{
$this->object = new Polluter;
Expand Down
7 changes: 5 additions & 2 deletions test/RequestTest.php
@@ -1,10 +1,13 @@
<?php
namespace Gongo\MercifulPolluter\Test;

use \PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use Gongo\MercifulPolluter\Request;

class RequestTest extends PHPUnit_Framework_TestCase
/**
* @backupGlobals enabled
*/
class RequestTest extends TestCase
{
private $object = null;

Expand Down
8 changes: 4 additions & 4 deletions test/SessionTest.php
@@ -1,16 +1,16 @@
<?php
namespace Gongo\MercifulPolluter\Test;

use \PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use Gongo\MercifulPolluter\Session;

/**
* @runTestsInSeparateProcesses
*/
class SessionTest extends PHPUnit_Framework_TestCase
class SessionTest extends TestCase
{
private $object = null;

protected function setUp()
{
$this->object = new Session;
Expand All @@ -19,7 +19,7 @@ protected function setUp()
public function testPollute()
{
session_start();

$_SESSION['userId'] = '1234';
$_SESSION['userName'] = 'Jack';

Expand Down
4 changes: 3 additions & 1 deletion test/bootstrap.php
@@ -1,2 +1,4 @@
<?php
require 'vendor/autoload.php';

require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/polyfill.php';
16 changes: 16 additions & 0 deletions test/polyfill.php
@@ -0,0 +1,16 @@
<?php

/**
* Polyfill for PHPUnit 4.8
*/

namespace PHPUnit\Framework
{
if (!class_exists('PHPUnit\\Framework\\TestCase')) {
abstract class TestCase extends PHPUnit_Framework_TestCase
{
}
} else {
class_alias('PHPUnit\Framework\Error\Warning', 'PHPUnit_Framework_Error_Warning');
}
}

0 comments on commit 94874d8

Please sign in to comment.