From 47f24ce05befd3b97686baafb0386bed22593be8 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Thu, 27 Jul 2017 12:05:27 +1200 Subject: [PATCH] Fixup test linting --- tests/php/ORM/Search/SearchContextTest.php | 12 ++++++------ tests/php/ORM/Search/SearchContextTest/Project.php | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/php/ORM/Search/SearchContextTest.php b/tests/php/ORM/Search/SearchContextTest.php index 4dfc3c77c..7f9d73a04 100644 --- a/tests/php/ORM/Search/SearchContextTest.php +++ b/tests/php/ORM/Search/SearchContextTest.php @@ -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); - - } } diff --git a/tests/php/ORM/Search/SearchContextTest/Project.php b/tests/php/ORM/Search/SearchContextTest/Project.php index efb383c44..ddabe813f 100644 --- a/tests/php/ORM/Search/SearchContextTest/Project.php +++ b/tests/php/ORM/Search/SearchContextTest/Project.php @@ -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';