mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fixup test linting
This commit is contained in:
parent
74873096bd
commit
47f24ce05b
@ -9,6 +9,7 @@ use SilverStripe\Forms\NumericField;
|
||||
use SilverStripe\Forms\DropdownField;
|
||||
use SilverStripe\Forms\CheckboxField;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\ORM\Filters\PartialMatchFilter;
|
||||
use SilverStripe\ORM\Search\SearchContext;
|
||||
|
||||
@ -103,7 +104,6 @@ class SearchContextTest extends SapphireTest
|
||||
{
|
||||
$company = SearchContextTest\Company::singleton();
|
||||
$context = $company->getDefaultSearchContext();
|
||||
$fields = $context->getFields();
|
||||
$this->assertEquals(
|
||||
new FieldList(
|
||||
new TextField("Name", 'Name'),
|
||||
@ -118,16 +118,18 @@ class SearchContextTest extends SapphireTest
|
||||
{
|
||||
$action3 = $this->objFromFixture(SearchContextTest\Action::class, 'action3');
|
||||
|
||||
$project = singleton(SearchContextTest\Project::class);
|
||||
$project = SearchContextTest\Project::singleton();
|
||||
$context = $project->getDefaultSearchContext();
|
||||
|
||||
$params = array("Name" => "Blog Website", "Actions__SolutionArea" => "technical");
|
||||
|
||||
/** @var DataList $results */
|
||||
$results = $context->getResults($params);
|
||||
|
||||
$this->assertEquals(1, $results->Count());
|
||||
$this->assertEquals(1, $results->count());
|
||||
|
||||
$project = $results->First();
|
||||
/** @var SearchContextTest\Project $project */
|
||||
$project = $results->first();
|
||||
|
||||
$this->assertInstanceOf(SearchContextTest\Project::class, $project);
|
||||
$this->assertEquals("Blog Website", $project->Name);
|
||||
@ -247,7 +249,5 @@ class SearchContextTest extends SapphireTest
|
||||
// "Nothing" should come back null since there's no field for it
|
||||
$nothing = $list->find('Field', 'Nothing');
|
||||
$this->assertNull($nothing);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,13 @@ namespace SilverStripe\ORM\Tests\Search\SearchContextTest;
|
||||
|
||||
use SilverStripe\Dev\TestOnly;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\HasManyList;
|
||||
|
||||
/**
|
||||
* @property string $Name
|
||||
* @method Deadline Deadline()
|
||||
* @method HasManyList Actions()
|
||||
*/
|
||||
class Project extends DataObject implements TestOnly
|
||||
{
|
||||
private static $table_name = 'SearchContextTest_Project';
|
||||
|
Loading…
x
Reference in New Issue
Block a user