Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/starter/tests/unit/HealthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class HealthTest extends CIUnitTestCase
{
public function testIsDefinedAppPath(): void
{
$this->assertTrue(defined('APPPATH'));
$this->assertDirectoryExists(APPPATH);
}

public function testBaseUrlHasBeenSet(): void
Expand Down
9 changes: 6 additions & 3 deletions tests/system/CLI/CLITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ public function testColorSupportOnHyperTerminals(): void
public function testStreamSupports(): void
{
$this->assertTrue(CLI::streamSupports('stream_isatty', STDOUT));
$this->assertIsBool(CLI::streamSupports('sapi_windows_vt100_support', STDOUT));
$this->assertSame(
function_exists('sapi_windows_vt100_support'),
CLI::streamSupports('sapi_windows_vt100_support', STDOUT),
);
}

public function testColor(): void
Expand Down Expand Up @@ -587,12 +590,12 @@ public function testWindow(): void
$height = new ReflectionProperty(CLI::class, 'height');
$height->setValue(null, null);

$this->assertIsInt(CLI::getHeight());
$this->assertGreaterThan(0, CLI::getHeight());

$width = new ReflectionProperty(CLI::class, 'width');
$width->setValue(null, null);

$this->assertIsInt(CLI::getWidth());
$this->assertGreaterThan(0, CLI::getWidth());
}

#[RequiresOperatingSystem('Darwin|Linux')]
Expand Down
2 changes: 1 addition & 1 deletion tests/system/CodeIgniterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ public function testStartControllerPermitsInvoke(): void
$startController();

// No PageNotFoundException
$this->assertTrue(true);
$this->expectNotToPerformAssertions();
}

public function testRouteAttributeCacheIntegration(): void
Expand Down
1 change: 0 additions & 1 deletion tests/system/CommonFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,6 @@ public static function provideCleanPathActuallyCleaningThePaths(): iterable

public function testIsCli(): void
{
$this->assertIsBool(is_cli());
$this->assertTrue(is_cli());
}

Expand Down
2 changes: 0 additions & 2 deletions tests/system/Config/FactoriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ public function testGetComponentInstances(): array

$data = Factories::getComponentInstances('config');

$this->assertIsArray($data);
$this->assertArrayHasKey('aliases', $data);
$this->assertArrayHasKey('instances', $data);

Expand Down Expand Up @@ -469,7 +468,6 @@ public function testSetComponentInstances(array $data): array

$data = Factories::getComponentInstances('config');

$this->assertIsArray($data);
$this->assertArrayHasKey('aliases', $data);
$this->assertArrayHasKey('instances', $data);

Expand Down
4 changes: 2 additions & 2 deletions tests/system/Database/Live/UpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testUpdateSetsAllWithoutWhereAndLimit(): void
} catch (DatabaseException) {
// This DB doesn't support Where and Limit together
// but we don't want it called a "Risky" test.
$this->assertTrue(true);
$this->expectNotToPerformAssertions();
}
}

Expand Down Expand Up @@ -110,7 +110,7 @@ public function testUpdateWithWhereAndLimit(): void
} catch (DatabaseException) {
// This DB doesn't support Where and Limit together
// but we don't want it called a "Risky" test.
$this->assertTrue(true);
$this->expectNotToPerformAssertions();
}
}

Expand Down
1 change: 0 additions & 1 deletion tests/system/HTTP/CLIRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ public function testFetchGlobalReturnsArrayValues(): void
$result = $this->request->fetchGlobal('post');

$this->assertSame($post, $result);
$this->assertIsArray($result['ANNOUNCEMENTS']);
$this->assertCount(2, $result['ANNOUNCEMENTS']);
}

Expand Down
1 change: 0 additions & 1 deletion tests/system/HTTP/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ public function testFetchGlobalReturnsArrayValues(): void
$result = $this->request->fetchGlobal('post');

$this->assertSame($post, $result);
$this->assertIsArray($result['ANNOUNCEMENTS']);
$this->assertCount(2, $result['ANNOUNCEMENTS']);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/URITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ public function testSetURISilent(): void

$uri->setSilent()->setURI($url);

$this->assertTrue(true);
$this->expectNotToPerformAssertions();
}

public function testCreateURIStringNoArguments(): void
Expand Down
3 changes: 1 addition & 2 deletions tests/system/Helpers/TextHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ public function testRandomString(): void
$this->assertSame(16, strlen(random_string('numeric', 16)));
$this->assertSame(8, strlen(random_string('numeric')));

$this->assertSame(16, strlen($random = random_string('crypto', 16)));
$this->assertIsString($random);
$this->assertSame(16, strlen(random_string('crypto', 16)));
}

/**
Expand Down
1 change: 0 additions & 1 deletion tests/system/HotReloader/DirectoryHasherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public function testHashApp(): void

$results = $this->hasher->hashApp();

$this->assertIsArray($results);
$this->assertArrayHasKey($this->fixtureDirectory, $results);
}

Expand Down
1 change: 0 additions & 1 deletion tests/system/Publisher/PublisherSupportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public function testGetScratch(): void

$scratch = $publisher->getScratch();

$this->assertIsString($scratch);
$this->assertDirectoryExists($scratch);
$this->assertDirectoryIsWritable($scratch);
$this->assertNotNull($this->getPrivateProperty($publisher, 'scratch'));
Expand Down
10 changes: 5 additions & 5 deletions tests/system/Security/SecurityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,11 @@ public function testGetters(): void
{
$security = $this->createMockSecurity();

$this->assertIsString($security->getHash());
$this->assertIsString($security->getTokenName());
$this->assertIsString($security->getHeaderName());
$this->assertIsString($security->getCookieName());
$this->assertIsBool($security->shouldRedirect());
$this->assertSame(32, strlen($security->getHash()));
$this->assertSame('csrf_test_name', $security->getTokenName());
$this->assertSame('X-CSRF-TOKEN', $security->getHeaderName());
$this->assertSame('csrf_cookie_name', $security->getCookieName());
$this->assertFalse($security->shouldRedirect());
}

public function testGetPostedTokenReturnsTokenFromPost(): void
Expand Down
4 changes: 3 additions & 1 deletion tests/system/Test/FabricatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ public function testGetFakerReturnsUsableGenerator(): void
$fabricator = new Fabricator(UserModel::class);

$faker = $fabricator->getFaker();
$digit = $faker->randomDigit();

$this->assertIsNumeric($faker->randomDigit());
$this->assertGreaterThanOrEqual(0, $digit);
$this->assertLessThanOrEqual(9, $digit);
}

public function testSetFormattersChangesFormatters(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Test/FilterTestTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\Test;

use Closure;
use CodeIgniter\HTTP\RequestInterface;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\Filters\Customfilter;
Expand Down Expand Up @@ -53,8 +54,7 @@ public function testGetCallerReturnsClosure(): void
{
$caller = $this->getFilterCaller('test-customfilter', 'before');

$this->assertIsCallable($caller);
$this->assertInstanceOf('Closure', $caller);
$this->assertInstanceOf(Closure::class, $caller);
}

public function testGetCallerInvalidPosition(): void
Expand Down
3 changes: 1 addition & 2 deletions utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 1808 errors
# total 1786 errors

includes:
- argument.type.neon
Expand All @@ -8,7 +8,6 @@ includes:
- deadCode.unreachable.neon
- empty.notAllowed.neon
- function.resultUnused.neon
- method.alreadyNarrowedType.neon
- method.childParameterType.neon
- method.childReturnType.neon
- method.notFound.neon
Expand Down
88 changes: 0 additions & 88 deletions utils/phpstan-baseline/method.alreadyNarrowedType.neon

This file was deleted.

Loading