mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
load files from extensions folder for tests; added new property in worthless_test
This commit is contained in:
@@ -3,9 +3,20 @@
|
|||||||
$dir = realpath(__DIR__);
|
$dir = realpath(__DIR__);
|
||||||
defined('BASE') OR define('BASE', dirname($dir) . '/');
|
defined('BASE') OR define('BASE', dirname($dir) . '/');
|
||||||
|
|
||||||
|
recursivelyIncludeFiles(BASE . 'extensions');
|
||||||
|
|
||||||
require_once BASE . 'parsecsv.lib.php';
|
require_once BASE . 'parsecsv.lib.php';
|
||||||
|
|
||||||
if (!class_exists('PHPUnit\Framework\TestCase')) {
|
if (!class_exists('PHPUnit\Framework\TestCase')) {
|
||||||
// we run on an older PHPUnit version without namespaces.
|
// we run on an older PHPUnit version without namespaces.
|
||||||
require_once __DIR__ . '/PHPUnit_Framework_TestCase.inc.php';
|
require_once __DIR__ . '/PHPUnit_Framework_TestCase.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function recursivelyIncludeFiles($pathName){
|
||||||
|
$dirIterator = new RecursiveDirectoryIterator($pathName);
|
||||||
|
foreach ($dirIterator as $dir) {
|
||||||
|
if ($dir->isFile() && $dir->getExtension() === 'php') {
|
||||||
|
require_once $dir->getPathname();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ class worthless_properties_Test extends PHPUnit\Framework\TestCase {
|
|||||||
'error',
|
'error',
|
||||||
'error_info',
|
'error_info',
|
||||||
'titles',
|
'titles',
|
||||||
'data'
|
'data',
|
||||||
|
'data_types',
|
||||||
);
|
);
|
||||||
|
|
||||||
// Find our real properties
|
// Find our real properties
|
||||||
@@ -129,7 +130,8 @@ class worthless_properties_Test extends PHPUnit\Framework\TestCase {
|
|||||||
public function test_count_public_properties() {
|
public function test_count_public_properties() {
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
|
|
||||||
for ($a = 0; $a < count($this->properties); $a++) {
|
$propertiesCount = count($this->properties);
|
||||||
|
for ($a = 0; $a < $propertiesCount; $a++) {
|
||||||
if ($this->properties[$a]->isPublic() === true) {
|
if ($this->properties[$a]->isPublic() === true) {
|
||||||
$counter++;
|
$counter++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user