Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Mar 27, 2023
1 parent 4bed569 commit cba33e7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="../../../tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
Expand Down
17 changes: 15 additions & 2 deletions tests/cases/classes/ModelObserverTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Laravel\Scout\Tests\Unit;
namespace Winter\Search\Tests\Cases\Classes;

use Config;
use Mockery as m;
use PluginTestCase;
use System\Tests\Bootstrap\PluginTestCase;
use Winter\Search\Classes\ModelObserver;
use Winter\Search\Tests\Fixtures\SearchableModelWithSoftDelete;
use Winter\Search\Tests\Fixtures\SearchableModelWithSensitiveAttributes;
Expand Down Expand Up @@ -274,4 +274,17 @@ protected function setSoftDeleting(bool $enabled)
{
Config::shouldReceive('get')->with('search.soft_delete', m::any())->andReturn($enabled);
}

/**
* Flush model event listeners.
*
* The models in Winter use a static property to store their events. These will need to be
* targeted and reset, ready for a new test cycle.
*
* Pivot models are an exception since they are internally managed.
*/
protected function flushModelEventListeners(): void
{

}
}
15 changes: 14 additions & 1 deletion tests/cases/traits/SearchableScopeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Winter\Search\Tests\Cases\Traits;

use Mockery as m;
use PluginTestCase;
use System\Tests\Bootstrap\PluginTestCase;
use Winter\Storm\Database\Builder;
use Winter\Search\Classes\SearchableScope;

Expand Down Expand Up @@ -33,4 +33,17 @@ public function testChunksById()

(new SearchableScope())->extend($builder);
}

/**
* Flush model event listeners.
*
* The models in Winter use a static property to store their events. These will need to be
* targeted and reset, ready for a new test cycle.
*
* Pivot models are an exception since they are internally managed.
*/
protected function flushModelEventListeners(): void
{

}
}

0 comments on commit cba33e7

Please sign in to comment.