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
1 parent
ade2dc4
commit 8d2e671
Showing
6 changed files
with
88 additions
and
3 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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/.* export-ignore | ||
/Examples export-ignore | ||
/tests export-ignore | ||
/phpunit.xml export-ignore |
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
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
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
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,33 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
|
||
<phpunit | ||
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' | ||
xsi:noNamespaceSchemaLocation='vendor/phpunit/phpunit/phpunit.xsd' | ||
beStrictAboutChangesToGlobalState='true' | ||
beStrictAboutOutputDuringTests='true' | ||
beStrictAboutTodoAnnotatedTests='true' | ||
bootstrap='./vendor/autoload.php' | ||
cacheResult='false' | ||
colors='true' | ||
columns='max' | ||
defaultTimeLimit='10' | ||
enforceTimeLimit='true' | ||
failOnRisky='true' | ||
failOnWarning='true' | ||
timeoutForSmallTests='10' | ||
timeoutForMediumTests='20' | ||
timeoutForLargeTests='30' | ||
verbose='true' | ||
> | ||
<testsuites> | ||
<testsuite name='all'> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<php> | ||
<ini name='display_errors' value='1' /> | ||
<ini name='display_startup_errors' value='1' /> | ||
<ini name='error_reporting' value='-1' /> | ||
</php> | ||
</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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Tpay\Tests\Model; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use RecursiveDirectoryIterator; | ||
use RecursiveIteratorIterator; | ||
use SplFileInfo; | ||
|
||
class ModelsTest extends TestCase | ||
{ | ||
/** | ||
* @coversNothing | ||
* | ||
* @dataProvider dataModel | ||
*/ | ||
public function testModel($class) | ||
{ | ||
self::assertTrue(class_exists($class) || interface_exists($class)); | ||
} | ||
|
||
public static function dataModel() | ||
{ | ||
$modelDirectory = realpath(__DIR__.'/../../Model'); | ||
|
||
/** @var SplFileInfo $fileInfo */ | ||
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($modelDirectory)) as $fileInfo) { | ||
if (!$fileInfo->isFile()) { | ||
continue; | ||
} | ||
|
||
$className = 'tpaySDK\\Model\\'.substr( | ||
$fileInfo->getRealPath(), | ||
strlen($modelDirectory) + 1, | ||
-4 | ||
); | ||
$className = str_replace('/', '\\', $className); | ||
|
||
yield $className => [$className]; | ||
} | ||
} | ||
} |