-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
4 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,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
bootstrap="test/bootstrap.php" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false"> | ||
<testsuites> | ||
<testsuite name="test"> | ||
<directory suffix="Test.php">./test/unit</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./src/*</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
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 |
---|---|---|
@@ -1,6 +1,31 @@ | ||
<?php | ||
// Composer autoload | ||
$autoloadFile = dirname(__DIR__) . '/vendor/autoload.php'; | ||
if (file_exists($autoloadFile)) { | ||
require_once $autoloadFile; | ||
// vendor at component dir | ||
if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) { | ||
require dirname(__DIR__) . '/vendor/autoload.php'; | ||
// application's vendor | ||
} elseif (file_exists(dirname(__DIR__, 3) . '/vendor/autoload.php')) { | ||
/** @var \Composer\Autoload\ClassLoader $loader */ | ||
$loader = require dirname(__DIR__, 3) . '/vendor/autoload.php'; | ||
|
||
// need load testing psr4 config map | ||
$componentDir = dirname(__DIR__, 3); | ||
$componentJson = $componentDir . '/composer.json'; | ||
$composerData = json_decode(file_get_contents($componentJson), true); | ||
foreach ($composerData['autoload-dev']['psr-4'] as $prefix => $dir) { | ||
$loader->addPsr4($prefix, $componentDir . '/' . $dir); | ||
} | ||
} elseif (file_exists(dirname(__DIR__, 5) . '/autoload.php')) { | ||
/** @var \Composer\Autoload\ClassLoader $loader */ | ||
$loader = require dirname(__DIR__, 5) . '/autoload.php'; | ||
|
||
// need load testing psr4 config map | ||
$componentDir = dirname(__DIR__, 3); | ||
$componentJson = $componentDir . '/composer.json'; | ||
$composerData = json_decode(file_get_contents($componentJson), true); | ||
|
||
foreach ($composerData['autoload-dev']['psr-4'] as $prefix => $dir) { | ||
$loader->addPsr4($prefix, $componentDir . '/' . $dir); | ||
} | ||
} else { | ||
exit('Please run "composer install" to install the dependencies' . PHP_EOL); | ||
} |
Empty file.
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,20 @@ | ||
<?php declare(strict_types=1); | ||
|
||
|
||
namespace SwoftTest\Server\Unit; | ||
|
||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Class ServerTest | ||
* | ||
* @since 2.0 | ||
*/ | ||
class ServerTest extends TestCase | ||
{ | ||
public function testMethod() | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
} |