-
Description:When I run my tests for my Laravel package using
Steps To Reproduce:
class BaseTestCase extends \Orchestra\Testbench\TestCase
{
public function setUp() : void
{
parent::setUp(); // the line that throws the error
}
protected function getApplicationProviders($app) : array
{
return [
MyApplicationKernelServiceProvider::class
];
}
protected function getEnvironmentSetUp($app) : void
{
$app['config']->set('database.default', 'testing');
$app['config']->set('database.connections.testing', [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
]);
}
}
class BaseTest extends BaseTestCase
{
public function test_we_can_run_tests() : void
{
$this->assertTrue(true);
}
}
Additional information
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<php>
<env name="DB_CONNECTION" value="testing"/>
<env name="APP_KEY" value="<removed>"/>
</php>
</phpunit> |
Beta Was this translation helpful? Give feedback.
Answered by
Drenth1
Mar 5, 2023
Replies: 1 comment
-
@crynobone you may delete this if you want. Solution is the same as in this discussion. I was using the wrong function and had to rename |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Drenth1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@crynobone you may delete this if you want.
Solution is the same as in this discussion.
I was using the wrong function and had to rename
getApplicationProviders()
togetPackageProviders()
.