Skip to content

Commit

Permalink
Merge pull request #15 from elifesciences/support-php-8.x
Browse files Browse the repository at this point in the history
Support PHP 8.x
  • Loading branch information
scottaubrey authored Oct 25, 2024
2 parents feccafe + 57766e4 commit bdc5b13
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 8 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/composer.lock
/.php_cs.cache
/vendor/
/.phpunit.result.cache
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/composer.lock
/.php_cs.cache
/vendor/
/.phpunit.result.cache
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"autoload-dev": {
"psr-4": {
"test\\eLife\\Logging\\": "./test"
"tests\\eLife\\Logging\\": "./test"
}
},
"require": {
Expand All @@ -19,16 +19,16 @@
"psr/log": "^1.0"
},
"require-dev": {
"crell/api-problem": "^2.0",
"crell/api-problem": "^2.0 || ^3.0",
"elife/api-problem": "^1.0",
"mikey179/vfsstream": "^1.6.11",
"phpunit/phpunit": "^5.7.7 || ^6.0",
"phpunit/phpunit": "^7.5 || ^9.6",
"pimple/pimple": "^3.0",
"silex/silex": "^2.0",
"silex/silex": "^2.2",
"squizlabs/php_codesniffer": "^3.5",
"symfony/browser-kit": "^3.0",
"symfony/debug": "^2.8 || ^3.0",
"symfony/http-kernel": "^2.7 || ^3.0"
"symfony/browser-kit": "^3.4",
"symfony/debug": "^3.4",
"symfony/http-kernel": "^3.4"
},
"suggest": {
"silex/silex": "^2.0, to use LoggerProvider"
Expand Down
1 change: 0 additions & 1 deletion test/Silex/LoggerProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use Silex\Application;
use Silex\WebTestCase;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Traversable;
Expand Down
67 changes: 67 additions & 0 deletions test/Silex/WebTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace tests\eLife\Logging\Silex;

use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpKernel\Client;
use Symfony\Component\HttpKernel\HttpKernelInterface;

echo "booo";

/**
* WebTestCase is the base class for functional tests.
*
* @author Igor Wiedler <[email protected]>
*/
abstract class WebTestCase extends TestCase
{
/**
* HttpKernelInterface instance.
*
* @var HttpKernelInterface
*/
protected $app;

/**
* PHPUnit setUp for setting up the application.
*
* Note: Child classes that define a setUp method must call
* parent::setUp().
*/
protected function setUp(): void
{
$this->app = $this->createApplication();
}

/**
* Creates the application.
*
* @return HttpKernelInterface
*/
abstract public function createApplication();

/**
* Creates a Client.
*
* @param array $server Server parameters
*
* @return Client A Client instance
*/
public function createClient(array $server = [])
{
if (!class_exists('Symfony\Component\BrowserKit\Client')) {
throw new \LogicException('Component "symfony/browser-kit" is required by WebTestCase.'.PHP_EOL.'Run composer require symfony/browser-kit');
}

return new Client($this->app, $server);
}
}

0 comments on commit bdc5b13

Please sign in to comment.