Skip to content

Commit

Permalink
utilize composer autoloading in tests (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored Feb 22, 2023
1 parent 2524090 commit 3c2e2c0
Show file tree
Hide file tree
Showing 19 changed files with 1,314 additions and 13,008 deletions.
11,279 changes: 11 additions & 11,268 deletions .phpstan-dba-mysqli.cache

Large diffs are not rendered by default.

973 changes: 22 additions & 951 deletions .phpstan-dba-pdo-mysql.cache

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
"staabm\\PHPStanDba\\Tests\\": "tests/"
},
"classmap": [
"tests/default/data/runMysqlQuery.php"
"tests/default/data/",
"tests/defaultFetchAssoc/data/",
"tests/defaultFetchNumeric/data/",
"tests/rules/data/",
"tests/stringify/data/"
]
},
"scripts": {
Expand Down
17 changes: 0 additions & 17 deletions tests/default/DbaInferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function dataFileAsserts(): iterable
}

// make sure class constants can be resolved
require_once __DIR__ . '/data/pdo.php';
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo.php');

if ('pdo-pgsql' === getenv('DBA_REFLECTOR')) {
Expand All @@ -32,31 +31,15 @@ public function dataFileAsserts(): iterable
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-mysql.php');
}
yield from $this->gatherAssertTypes(__DIR__ . '/data/dibi.php');

// make sure class constants can be resolved
require_once __DIR__ . '/data/pdo-quote.php';
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-quote.php');

// make sure class constants can be resolved
require_once __DIR__ . '/data/pdo-prepare.php';
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-prepare.php');

// make sure class constants can be resolved
require_once __DIR__ . '/data/pdo-stmt-fetch.php';
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-stmt-fetch.php');

// make sure class constants can be resolved
require_once __DIR__ . '/data/pdo-fetch-types.php';
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-fetch-types.php');

yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-column-count.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-stmt-execute.php');

yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli-escape.php');

// make sure class definitions within the test files are known to reflection
require_once __DIR__ . '/data/runMysqlQuery.php';
yield from $this->gatherAssertTypes(__DIR__ . '/data/runMysqlQuery.php');

// TODO pgsql: doesn't resolve null?
Expand Down
Loading

0 comments on commit 3c2e2c0

Please sign in to comment.