for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Firesphere\SolrSubsites\Tests;
use Firesphere\SolrSubsites\States\SubsiteState;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Subsites\Model\Subsite;
class SubsiteStateTest extends SapphireTest
{
public function testIsApplicable()
$state = new SubsiteState();
$this->assertFalse($state->stateIsApplicable(0));
}
public function testSetDefaultState()
$this->assertNull($state->setDefaultState(0));
$state->setDefaultState(0)
Firesphere\SolrSubsites\...tate::setDefaultState()
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.
public function testCurrentState()
$this->assertNull($state->currentState());
public function testActivateState()
$state->activateState(0);
$this->assertTrue(Subsite::$disable_subsite_filter);
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.