-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed tests which require a webserver
- Loading branch information
1 parent
82d4268
commit 7b613a7
Showing
6 changed files
with
344 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the BeSimpleSoapClient. | ||
* | ||
* (c) Christian Kerl <christian-kerl@web.de> | ||
* (c) Francis Besset <francis.besset@gmail.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace BeSimple\SoapClient\Tests; | ||
|
||
use Symfony\Component\Process\PhpExecutableFinder; | ||
use Symfony\Component\Process\ProcessBuilder; | ||
|
||
/** | ||
* @author francis.besset@gmail.com <francis.besset@gmail.com> | ||
*/ | ||
abstract class AbstractWebServerTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var ProcessBuilder | ||
*/ | ||
static protected $webserver; | ||
static protected $websererPortLength; | ||
|
||
public static function setUpBeforeClass() | ||
{ | ||
if (version_compare(PHP_VERSION, '5.4.0', '<')) { | ||
self::markTestSkipped('PHP Webserver is available from PHP 5.4'); | ||
} | ||
|
||
self::$webserver = ProcessBuilder::create(array( | ||
'exec', // used exec binary (https://github.com/symfony/symfony/issues/5759) | ||
(new PhpExecutableFinder())->find(), | ||
'-S', | ||
sprintf('localhost:%d', WEBSERVER_PORT), | ||
'-t', | ||
__DIR__.DIRECTORY_SEPARATOR.'Fixtures', | ||
))->getProcess(); | ||
|
||
self::$webserver->start(); | ||
usleep(100000); | ||
|
||
self::$websererPortLength = strlen(WEBSERVER_PORT); | ||
} | ||
|
||
public static function tearDownAfterClass() | ||
{ | ||
self::$webserver->stop(0); | ||
usleep(100000); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.