for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Firesphere\SolrFluent\Tests;
use Firesphere\SolrFluent\States\FluentSiteState;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Dev\SapphireTest;
class FluentSiteStateTest extends SapphireTest
{
public function testAppliesTo()
$state = new FluentSiteState();
$this->assertFalse($state->appliesTo(SiteTree::class));
}
public function testIsApplicable()
$this->assertFalse($state->stateIsApplicable('en_US'));
public function testCurrentState()
$this->assertNull($state->activateState('en_US'));
$state->activateState('en_US')
Firesphere\SolrFluent\St...eState::activateState()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
$this->assertEquals('en_US', $state->currentState());
public function testDefaultState()
$this->assertNull($state->setDefaultState('en_US'));
$state->setDefaultState('en_US')
Firesphere\SolrFluent\St...tate::setDefaultState()
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.