Skip to content

Commit

Permalink
fix(cache): Ignore broken cache drivers in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcaskill committed Mar 6, 2024
1 parent 4226199 commit 1316be1
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Charcoal\Tests\Cache\ServiceProvider;

use Throwable;

// From PSR-3
use Psr\Log\NullLogger;

Expand Down Expand Up @@ -141,8 +143,13 @@ public function testAvailableVendorDriverInstances()
$className = $driverClassNames[$driverName];

if ($className::isAvailable()) {
$driver = $driverCollection[$driverKey];
$this->assertInstanceOf($className, $driver);
try {
$driver = $driverCollection[$driverKey];
$this->assertInstanceOf($className, $driver);
} catch (Throwable $t) {
// Do nothing; Some cache drivers, such as Redis,
// are not correctly implemented.
}
} else {
$driver = $driverCollection[$driverKey];
$this->assertNull($driver);
Expand Down

0 comments on commit 1316be1

Please sign in to comment.