Skip to content

Commit 3c2e2c0

Browse files
authored
utilize composer autoloading in tests (#537)
1 parent 2524090 commit 3c2e2c0

19 files changed

+1314
-13008
lines changed

.phpstan-dba-mysqli.cache

Lines changed: 11 additions & 11268 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.phpstan-dba-pdo-mysql.cache

Lines changed: 22 additions & 951 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
"staabm\\PHPStanDba\\Tests\\": "tests/"
3838
},
3939
"classmap": [
40-
"tests/default/data/runMysqlQuery.php"
40+
"tests/default/data/",
41+
"tests/defaultFetchAssoc/data/",
42+
"tests/defaultFetchNumeric/data/",
43+
"tests/rules/data/",
44+
"tests/stringify/data/"
4145
]
4246
},
4347
"scripts": {

tests/default/DbaInferenceTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public function dataFileAsserts(): iterable
2323
}
2424

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

2928
if ('pdo-pgsql' === getenv('DBA_REFLECTOR')) {
@@ -32,31 +31,15 @@ public function dataFileAsserts(): iterable
3231
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-mysql.php');
3332
}
3433
yield from $this->gatherAssertTypes(__DIR__ . '/data/dibi.php');
35-
36-
// make sure class constants can be resolved
37-
require_once __DIR__ . '/data/pdo-quote.php';
3834
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-quote.php');
39-
40-
// make sure class constants can be resolved
41-
require_once __DIR__ . '/data/pdo-prepare.php';
4235
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-prepare.php');
43-
44-
// make sure class constants can be resolved
45-
require_once __DIR__ . '/data/pdo-stmt-fetch.php';
4636
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-stmt-fetch.php');
47-
48-
// make sure class constants can be resolved
49-
require_once __DIR__ . '/data/pdo-fetch-types.php';
5037
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-fetch-types.php');
51-
5238
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-column-count.php');
5339
yield from $this->gatherAssertTypes(__DIR__ . '/data/pdo-stmt-execute.php');
54-
5540
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli.php');
5641
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli-escape.php');
5742

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

6245
// TODO pgsql: doesn't resolve null?

0 commit comments

Comments
 (0)