for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the jquery-datatables-bundle package.
*
* (c) 2022 WEBEWEB
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace WBW\Bundle\JQuery\DataTablesBundle\Tests\Renderer\Strings;
use WBW\Bundle\JQuery\DataTablesBundle\Tests\AbstractTestCase;
use WBW\Bundle\JQuery\DataTablesBundle\Tests\Fixtures\Renderer\Strings\TestLeftAlignedTextRendererTrait;
/**
* Left-aligned text renderer trait test.
* @author webeweb <https://github.com/webeweb>
* @package WBW\Bundle\JQuery\DataTablesBundle\Tests\Renderer\Strings
class LeftAlignedTextRendererTraitTest extends AbstractTestCase {
* Test renderLeftAlignedText()
* @return void
public function testRenderLeftAlignedText(): void {
$obj = new TestLeftAlignedTextRendererTrait();
$this->assertNull($obj->renderLeftAlignedText(null));
$obj->renderLeftAlignedText(null)
WBW\Bundle\JQuery\DataTa...renderLeftAlignedText()
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->assertNull($obj->renderLeftAlignedText(""));
$obj->renderLeftAlignedText('')
$this->assertEquals('<span class="text-left">content</span>', $obj->renderLeftAlignedText("content"));
}
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.