mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 08:09:18 +02:00
Add code coverage configuration (phpunit.xml source filter), baseline coverage report (21.27% lines), gitignore coverage/ and .phpunit.result.cache; remove deprecated setAccessible() calls
This commit is contained in:
@@ -25,7 +25,6 @@ class DatabaseExtendedTest extends TestCase
|
||||
// Build conditions with special LIKE characters in query
|
||||
// Use reflection to call the private method
|
||||
$ref = new ReflectionMethod(Database::class, 'escapeLikeString');
|
||||
$ref->setAccessible(true);
|
||||
|
||||
$this->assertSame('\\\\', $ref->invoke($this->db, '\\'));
|
||||
$this->assertSame('\\%', $ref->invoke($this->db, '%'));
|
||||
@@ -39,7 +38,6 @@ class DatabaseExtendedTest extends TestCase
|
||||
public function testBuildSearchConditionsEmptyParams(): void
|
||||
{
|
||||
$ref = new ReflectionMethod(Database::class, 'buildSearchConditions');
|
||||
$ref->setAccessible(true);
|
||||
|
||||
[$conditions, $bindings] = $ref->invoke($this->db, []);
|
||||
|
||||
@@ -51,7 +49,6 @@ class DatabaseExtendedTest extends TestCase
|
||||
public function testBuildSearchConditionsWithQuery(): void
|
||||
{
|
||||
$ref = new ReflectionMethod(Database::class, 'buildSearchConditions');
|
||||
$ref->setAccessible(true);
|
||||
|
||||
[$conditions, $bindings] = $ref->invoke($this->db, ['query' => 'test']);
|
||||
|
||||
@@ -63,7 +60,6 @@ class DatabaseExtendedTest extends TestCase
|
||||
public function testBuildSearchConditionsWithYear(): void
|
||||
{
|
||||
$ref = new ReflectionMethod(Database::class, 'buildSearchConditions');
|
||||
$ref->setAccessible(true);
|
||||
|
||||
[$conditions, $bindings] = $ref->invoke($this->db, ['year' => 2024]);
|
||||
|
||||
@@ -74,7 +70,6 @@ class DatabaseExtendedTest extends TestCase
|
||||
public function testBuildSearchConditionsWithAllFilters(): void
|
||||
{
|
||||
$ref = new ReflectionMethod(Database::class, 'buildSearchConditions');
|
||||
$ref->setAccessible(true);
|
||||
|
||||
[$conditions, $bindings] = $ref->invoke($this->db, [
|
||||
'query' => 'art',
|
||||
|
||||
@@ -15,7 +15,6 @@ class StudentEmailTest extends TestCase
|
||||
private function buildHtml(array $thesis): string
|
||||
{
|
||||
$ref = new ReflectionMethod(StudentEmail::class, 'buildHtml');
|
||||
$ref->setAccessible(true);
|
||||
|
||||
return $ref->invoke(null, $thesis);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ class ThesisCreateValidationTest extends TestCase
|
||||
private function validate(array $post, bool $adminMode = false): array
|
||||
{
|
||||
$ref = new ReflectionMethod(ThesisCreateController::class, 'validateAndSanitise');
|
||||
$ref->setAccessible(true);
|
||||
|
||||
$db = TestDatabase::getInstance();
|
||||
$ctrl = new ThesisCreateController($db);
|
||||
|
||||
@@ -63,7 +63,6 @@ class ThesisEditValidationTest extends TestCase
|
||||
private function collectJuryMembers(array $post): array
|
||||
{
|
||||
$ref = new ReflectionMethod(ThesisEditController::class, 'collectJuryMembers');
|
||||
$ref->setAccessible(true);
|
||||
return $ref->invoke($this->ctrl, $post);
|
||||
}
|
||||
|
||||
@@ -142,7 +141,6 @@ class ThesisEditValidationTest extends TestCase
|
||||
private function invokeHandleWebsiteUrl(int $thesisId, array $post): void
|
||||
{
|
||||
$ref = new ReflectionMethod(ThesisEditController::class, 'handleWebsiteUrl');
|
||||
$ref->setAccessible(true);
|
||||
$ref->invoke($this->ctrl, $thesisId, $post);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user