Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Symfony5 class names in connectors #5670

Merged
merged 1 commit into from
Sep 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions shim.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,9 @@ class WebDriverTimeouts extends Facebook\WebDriver\WebDriverTimeouts {};
class WebDriverWindow extends Facebook\WebDriver\WebDriverWindow {};
interface WebDriverElement extends Facebook\WebDriver\WebDriverElement {};
}

//Alias for Symfony < 4.3
if (!class_exists('Symfony\Component\BrowserKit\AbstractBrowser') && class_exists('Symfony\Component\BrowserKit\Client')) {
class_alias('Symfony\Component\BrowserKit\Client', 'Symfony\Component\BrowserKit\AbstractBrowser');
}
}
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Connector/Guzzle.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use GuzzleHttp\Psr7\Request as Psr7Request;
use GuzzleHttp\Psr7\Response as Psr7Response;
use GuzzleHttp\Psr7\Uri as Psr7Uri;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\BrowserKit\AbstractBrowser as Client;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\BrowserKit\Request as BrowserKitRequest;
use Symfony\Component\BrowserKit\Response as BrowserKitResponse;
Expand Down
7 changes: 6 additions & 1 deletion src/Codeception/Lib/Connector/Laravel5.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
use Illuminate\Http\UploadedFile;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Client;
use Symfony\Component\HttpKernel\HttpKernelBrowser as Client;

//Alias for Symfony < 4.3
if (!class_exists('Symfony\Component\HttpKernel\HttpKernelBrowser') && class_exists('Symfony\Component\HttpKernel\Client')) {
class_alias('Symfony\Component\HttpKernel\Client', 'Symfony\Component\HttpKernel\HttpKernelBrowser');
}

class Laravel5 extends Client
{
Expand Down
7 changes: 6 additions & 1 deletion src/Codeception/Lib/Connector/Lumen.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
use Illuminate\Support\Facades\Facade;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Client;
use Symfony\Component\HttpKernel\HttpKernelBrowser as Client;
use Illuminate\Http\UploadedFile;

//Alias for Symfony < 4.3
if (!class_exists('Symfony\Component\HttpKernel\HttpKernelBrowser') && class_exists('Symfony\Component\HttpKernel\Client')) {
class_alias('Symfony\Component\HttpKernel\Client', 'Symfony\Component\HttpKernel\HttpKernelBrowser');
}

class Lumen extends Client
{
use LaravelCommon;
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Connector/Phalcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Codeception\Util\Stub;
use Phalcon\Mvc\Application;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\BrowserKit\AbstractBrowser as Client;
use Phalcon\Mvc\Micro as MicroApplication;
use Symfony\Component\BrowserKit\Response;
use Codeception\Lib\Connector\Shared\PhpSuperGlobalsConverter;
Expand Down
9 changes: 8 additions & 1 deletion src/Codeception/Lib/Connector/Symfony.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<?php
namespace Codeception\Lib\Connector;

class Symfony extends \Symfony\Component\HttpKernel\Client
use Symfony\Component\HttpKernel\HttpKernelBrowser;

//Alias for Symfony < 4.3
if (!class_exists('Symfony\Component\HttpKernel\HttpKernelBrowser') && class_exists('Symfony\Component\HttpKernel\Client')) {
class_alias('Symfony\Component\HttpKernel\Client', 'Symfony\Component\HttpKernel\HttpKernelBrowser');
}

class Symfony extends HttpKernelBrowser
{
/**
* @var boolean
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Connector/Universal.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Codeception\Lib\Connector;

use Symfony\Component\BrowserKit\Client;
use Symfony\Component\BrowserKit\AbstractBrowser as Client;
use Symfony\Component\BrowserKit\Response;

class Universal extends Client
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Connector/Yii1.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Codeception\Lib\Connector;

use Codeception\Util\Stub;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\BrowserKit\AbstractBrowser as Client;
use Symfony\Component\BrowserKit\Response;

class Yii1 extends Client
Expand Down
4 changes: 1 addition & 3 deletions src/Codeception/Lib/Connector/Yii2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
namespace Codeception\Lib\Connector;

use Codeception\Exception\ConfigurationException;
use Codeception\Exception\ModuleException;
use Codeception\Lib\Connector\Yii2\Logger;
use Codeception\Lib\Connector\Yii2\TestMailer;
use Codeception\Lib\InnerBrowser;
use Codeception\Util\Debug;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\BrowserKit\AbstractBrowser as Client;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\BrowserKit\Response;
use Yii;
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Connector/ZF2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Codeception\Lib\Connector;

use Codeception\Lib\Connector\ZF2\PersistentServiceManager;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\BrowserKit\AbstractBrowser as Client;
use Symfony\Component\BrowserKit\Response;
use Zend\Http\Request as HttpRequest;
use Zend\Http\Headers as HttpHeaders;
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Connector/ZendExpressive.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Codeception\Configuration;
use Codeception\Lib\Connector\ZendExpressive\ResponseCollector;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\BrowserKit\AbstractBrowser as Client;
use Symfony\Component\BrowserKit\Response;
use Symfony\Component\BrowserKit\Request as BrowserKitRequest;
use Zend\Diactoros\ServerRequest;
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Lib/InnerBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class InnerBrowser extends Module implements Web, PageSourceSaver, ElementLocato

/**
* @api
* @var \Symfony\Component\BrowserKit\Client
* @var \Symfony\Component\BrowserKit\AbstractBrowser
*/
public $client;

Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Module/REST.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class REST extends CodeceptionModule implements DependsOnModule, PartedModule, A
protected $DEFAULT_SHORTEN_VALUE = 150;

/**
* @var \Symfony\Component\HttpKernel\Client|\Symfony\Component\BrowserKit\Client
* @var \Symfony\Component\HttpKernel\HttpKernelBrowser|\Symfony\Component\BrowserKit\AbstractBrowser
*/
public $client = null;
public $isFunctional = false;
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Module/SOAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class SOAP extends CodeceptionModule implements DependsOnModule
EOF;

/**
* @var \Symfony\Component\BrowserKit\Client
* @var \Symfony\Component\BrowserKit\AbstractBrowser
*/
public $client = null;
public $isFunctional = false;
Expand Down