Skip to content

Commit

Permalink
phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Oct 31, 2024
1 parent edc455b commit 35ef2bb
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 79 deletions.
Empty file added tests/Entity/.gitkeep
Empty file.
23 changes: 0 additions & 23 deletions tests/Entity/Blameable.php

This file was deleted.

23 changes: 0 additions & 23 deletions tests/Entity/IpTraceable.php

This file was deleted.

23 changes: 0 additions & 23 deletions tests/Entity/Timestamps.php

This file was deleted.

2 changes: 2 additions & 0 deletions tests/Feature/Gedmo/SubscribeAllTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use LaravelDoctrineTest\Extensions\Feature\TestCase;
use Mockery as m;

use function app;

/**
* This test case is used to test all Gedmo extensions at once.
* The point of this repository is not to test the functionality of the extensions,
Expand Down
2 changes: 2 additions & 0 deletions tests/Feature/Gedmo/Uploadable/UploadableExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use LaravelDoctrineTest\Extensions\Feature\TestCase;
use Mockery as m;

use function app;

class UploadableExtensionTest extends TestCase
{
public function testCanRegisterExtension(): void
Expand Down
24 changes: 14 additions & 10 deletions tests/Feature/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\SchemaTool;
use Illuminate\Config\Repository;
use LaravelDoctrineTest\Extensions\Entity\Artist;
use Illuminate\Foundation\Application;
use Mockery as m;
use Orchestra\Testbench\Concerns\WithWorkbench;
use Orchestra\Testbench\TestCase as OrchestraTestCase;

use function restore_error_handler;
use function restore_exception_handler;
use function tap;

abstract class TestCase extends OrchestraTestCase
{
Expand All @@ -24,27 +25,30 @@ abstract class TestCase extends OrchestraTestCase
protected EventManager $evm;
protected EntityManagerInterface $em;

protected function defineEnvironment($app)
/**
* @param Application $app
*
* phpcs:disable
*/
protected function defineEnvironment($app): void
{
// Setup default database to use sqlite :memory:
tap($app['config'], function (Repository $config) {
tap($app['config'], static function (Repository $config): void {
$config->set('doctrine.managers.default', [
'meta' => 'attributes',
'connection' => 'testbench',
'paths' => [
__DIR__ . '/../Entity'
],
'paths' => [__DIR__ . '/../Entity'],
'proxies' => [
'auto_generate' => true,
'path' => __DIR__ . '/../proxy',
'namespace' => 'Proxy',
]
],
]);

$config->set('database.connections.testbench', [
'driver' => 'sqlite',
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
'prefix' => '',
]);
});
}
Expand All @@ -53,7 +57,7 @@ public function setUp(): void
{
parent::setUp();

$this->em = $this->app->get(EntityManager::class);
$this->em = $this->app->get(EntityManager::class);
$this->evm = $this->em->getEventManager();

(new SchemaTool($this->em))->createSchema($this->em->getMetadataFactory()->getAllMetadata());
Expand Down

0 comments on commit 35ef2bb

Please sign in to comment.