Skip to content

Commit

Permalink
Test Improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Mar 3, 2025
1 parent 824ac3e commit b66705f
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 24 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"league/flysystem-read-only": "^3.25.1",
"league/flysystem-sftp-v3": "^3.25.1",
"mockery/mockery": "^1.6.10",
"orchestra/testbench-core": "9.x-dev",
"orchestra/testbench-core": "9.11.x-dev",
"pda/pheanstalk": "^5.0.6",
"php-http/discovery": "^1.15",
"phpstan/phpstan": "^2.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Cache/DynamoDbStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function testLocksCanBeAcquired()
* @param \Illuminate\Foundation\Application $app
* @return void
*/
protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
if (! env('DYNAMODB_CACHE_TABLE')) {
$this->markTestSkipped('DynamoDB not configured.');
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Cookie/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function test_cookie_is_sent_back_with_proper_expire_time_with_respect_to
$this->assertEquals(Carbon::now()->getTimestamp() + 60, $response->headers->getCookies()[1]->getExpiresTime());
}

protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
$app->instance(
ExceptionHandler::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function setUp(): void
}
}

protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
$connection = $app->make('config')->get('database.default');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#[RequiresPhpExtension('pdo_mysql')]
class DatabaseEmulatePreparesMariaDbConnectionTest extends DatabaseMariaDbConnectionTest
{
protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
parent::getEnvironmentSetUp($app);
parent::defineEnvironment($app);

$app['config']->set('database.connections.mariadb.options', [
PDO::ATTR_EMULATE_PREPARES => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#[RequiresPhpExtension('pdo_mysql')]
class DatabaseEmulatePreparesMySqlConnectionTest extends DatabaseMySqlConnectionTest
{
protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
parent::getEnvironmentSetUp($app);
parent::defineEnvironment($app);

$app['config']->set('database.connections.mysql.options', [
PDO::ATTR_EMULATE_PREPARES => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#[RequiresPhpExtension('pdo_pgsql')]
class PostgresSchemaBuilderTest extends PostgresTestCase
{
protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
parent::getEnvironmentSetUp($app);
parent::defineEnvironment($app);

$app['config']->set('database.connections.pgsql.search_path', 'public,private');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Mail/SendingMarkdownMailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class SendingMarkdownMailTest extends TestCase
{
protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
$app['config']->set('mail.driver', 'array');

Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Mail/SendingQueuedMailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class SendingQueuedMailTest extends TestCase
{
protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
$app['config']->set('mail.driver', 'array');

Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/Queue/JobEncryptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class JobEncryptionTest extends DatabaseTestCase
{
use DatabaseMigrations;

protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
parent::getEnvironmentSetUp($app);
parent::defineEnvironment($app);

$app['config']->set('app.key', Str::random(32));
$app['config']->set('queue.default', 'database');
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Queue/ModelSerializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ModelSerializationTest extends TestCase
{
use RefreshDatabase;

protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
$app['config']->set('database.connections.custom', [
'driver' => 'sqlite',
Expand Down
9 changes: 3 additions & 6 deletions tests/Integration/Queue/QueueConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\Bus;
use Mockery as m;
use Orchestra\Testbench\Attributes\WithConfig;
use Orchestra\Testbench\TestCase;
use Throwable;

#[WithConfig('queue.default', 'sqs')]
#[WithConfig('queue.connections.sqs.after_commit', true)]
class QueueConnectionTest extends TestCase
{
protected function getEnvironmentSetUp($app)
{
$app['config']->set('queue.default', 'sqs');
$app['config']->set('queue.connections.sqs.after_commit', true);
}

protected function tearDown(): void
{
QueueConnectionTestJob::$ran = false;
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/View/BladeAnonymousComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function test_anonymous_components_with_custom_paths_cant_be_rendered_as_
$view = View::make('panel')->render();
}

protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
$app['config']->set('view.paths', [__DIR__.'/anonymous-components-templates']);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/View/BladeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function testViewCacheCommandHandlesConfiguredBladeExtensions()
$this->artisan('view:clear');
}

protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
$app['config']->set('view.paths', [__DIR__.'/templates']);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/View/RenderableViewExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function testRenderMethodOfExceptionThrownInViewGetsHandled()
$response->assertSee('This is a renderable exception.');
}

protected function getEnvironmentSetUp($app)
protected function defineEnvironment($app)
{
$app['config']->set('view.paths', [__DIR__.'/templates']);
}
Expand Down

0 comments on commit b66705f

Please sign in to comment.