Skip to content

Commit

Permalink
Update tests to v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ttimot24 committed Dec 7, 2024
1 parent c1389b7 commit 19e5d63
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Model/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ public static function has($setting){

public static function getAll(){

$array = [];

foreach(self::all() as $each){
$array[$each->setting] = $each->value;
}


return $array;
}

Expand Down
3 changes: 3 additions & 0 deletions resources/tests/unit/Middleware/SettingsMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class SettingsMiddlewareTest extends TestCase
/** @test */
public function testSettingsAreSet()
{

\Config::set('horizontcms.installed', true);

$request = new Request;

$middleware = new \App\Http\Middleware\SettingsMiddleware(new Settings());
Expand Down
5 changes: 5 additions & 0 deletions resources/tests/unit/SearchEngineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ public function testExecuteSearch()

public function testClearResults()
{

$page = new \App\Model\Page(['name' => 'Home','slug'=>'home', 'visibility' => 1, 'parent_id' => 1, 'queue' => 1, 'page' => 'asd', 'active' => 1]);
$page->author_id = 1;
$page->save();

$this->engine->registerModel(\App\Model\Page::class);
$this->engine->executeSearch('home');
$this->assertEquals(1, count($this->engine->getResultsFor(\App\Model\Page::class)));
Expand Down

0 comments on commit 19e5d63

Please sign in to comment.