-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throws an exception if null driver is given.
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Illuminate\Tests\Integration\Support\Fixtures; | ||
|
||
use Illuminate\Support\Manager; | ||
|
||
class NullableManager extends Manager | ||
{ | ||
/** | ||
* Get the default driver name. | ||
* | ||
* @return string | ||
*/ | ||
public function getDefaultDriver() | ||
{ | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Illuminate\Tests\Integration\Support; | ||
|
||
use Orchestra\Testbench\TestCase; | ||
|
||
class ManagerTest extends TestCase | ||
{ | ||
/** | ||
* @expectedException \InvalidArgumentException | ||
* @expectedExceptionMessage Unable to resolve NULL driver for Illuminate\Tests\Integration\Support\Fixtures\NullableManager | ||
*/ | ||
public function testDefaultDriverCannotBeNull() | ||
{ | ||
(new Fixtures\NullableManager($this->app))->driver(); | ||
} | ||
} |