Skip to content

FOUR-24917: Fix unit tests #8346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: poc/FOUR-22888-Multitenancy
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ProcessMaker/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot()
{
\Log::info('AuthServiceProvider boot');

$this->registerPolicies();

Passport::enablePasswordGrant();
Expand Down
2 changes: 1 addition & 1 deletion phpunit.package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<!-- Workflow Database -->
<env name="DB_ADAPTER" value="mysql" />
<env name="DB_DATABASE" value="test" />
<env name="DB_DATABASE" value="processmaker" />
<env name="DB_TIMEZONE" value="+00:00" />
<env name="NAYRA_DOCKER_NETWORK" value="pm4-tools_default" />

Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

<!-- Workflow Database -->
<env name="DB_ADAPTER" value="mysql" />
<env name="DB_DATABASE" value="test" />
<env name="DB_DATABASE" value="processmaker" />
<env name="DB_TIMEZONE" value="+00:00" />
<env name="NAYRA_DOCKER_NETWORK" value="pm4-tools_default" />

Expand Down
11 changes: 3 additions & 8 deletions tests/Feature/Docker/TimeoutsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,12 @@ class TimeoutsTest extends TestCase
// How long to sleep our test scripts that should not exceed timeout
const SLEEP_NOT_EXCEED = 1;

/**
* Make sure we have a personal access client set up
*/
public function setUpWithPersonalAccessClient()
{
$this->withPersonalAccessClient();
}

/**
* Run a test script and assert that the specified timeout is exceeded
*/
private function assertTimeoutExceeded($data)
{
$this->withPersonalAccessClient();
Event::fake([
ScriptResponseEvent::class,
]);
Expand Down Expand Up @@ -95,6 +88,7 @@ private function assertTimeoutNotExceeded($data)
*/
public function testPhpScriptTimeoutExceeded()
{
$this->withPersonalAccessClient();
config(['simulate_timeout' => true]);
$this->assertTimeoutExceeded([
'language' => 'php',
Expand All @@ -107,6 +101,7 @@ public function testPhpScriptTimeoutExceeded()
*/
public function testPhpScriptTimeoutNotExceeded()
{
$this->withPersonalAccessClient();
$this->assertTimeoutNotExceeded([
'language' => 'php',
'timeout' => self::TIMEOUT_LENGTH,
Expand Down
7 changes: 7 additions & 0 deletions tests/Feature/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Tests\Feature;

use Illuminate\Routing\Router;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Tests\Feature\Shared\RequestHelper;
use Tests\TestCase;

Expand All @@ -14,6 +15,12 @@ class RouteTest extends TestCase
* This this does some basic checks to make sure we converted routes
* to the correct class-based routes as part of the Laravel 8 upgrade
*/
protected function setUp(): void
{
parent::setUp();
config(['queue.tenant_tracking_enabled' => true]);
}

public function testIndexRoute()
{
$ethosRoutePath = base_path('vendor/processmaker/package-ellucian-ethos/routes/');
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Shared/LoggingHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function assertLogIsEmpty()
{
$records = app('log')->getHandlers()[0]->getRecords();

return $this->assertEquals(0, count($records), 'Failed asserting that the log is empty.');
return $this->assertEquals(0, count($records), 'Failed asserting that the log is empty: ' . print_r($records, true));
}

/**
Expand Down
Loading