-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use luya select for ngrest filters (#419)
* use luya select for ngrest filters * add syntax error test * changelog * fix changelog
- Loading branch information
Showing
7 changed files
with
133 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace admintests\admin\ngrest\base; | ||
|
||
use admintests\AdminModelTestCase; | ||
use luya\admin\models\User; | ||
use luya\admin\ngrest\base\Controller; | ||
use luya\testsuite\fixtures\NgRestModelFixture; | ||
use luya\testsuite\scopes\PermissionScope; | ||
use luya\testsuite\traits\AdminDatabaseTableTrait; | ||
|
||
class ControllerTest extends AdminModelTestCase | ||
{ | ||
use AdminDatabaseTableTrait; | ||
|
||
public function testIndex() | ||
{ | ||
$fixture = new NgRestModelFixture([ | ||
'modelClass' => User::class, | ||
]); | ||
|
||
PermissionScope::run($this->app, function(PermissionScope $scope) { | ||
$scope->loginUser(); | ||
|
||
$stub = new StubController('id', $this->app); | ||
$html = $stub->actionIndex(); | ||
|
||
$this->assertNotEmpty($html); | ||
}); | ||
|
||
} | ||
} | ||
|
||
class StubController extends Controller | ||
{ | ||
public $modelClass = User::class; | ||
} |