Issues (117)

Strings/CenterAlignedTextRendererTraitTest.php (2 issues)

Labels
Severity
1
<?php
2
3
/*
4
 * This file is part of the jquery-datatables-bundle package.
5
 *
6
 * (c) 2022 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\JQuery\DataTablesBundle\Tests\Renderer\Strings;
13
14
use WBW\Bundle\JQuery\DataTablesBundle\Tests\AbstractTestCase;
15
use WBW\Bundle\JQuery\DataTablesBundle\Tests\Fixtures\Renderer\Strings\TestCenterAlignedTextRendererTrait;
16
17
/**
18
 * Center-aligned text renderer trait test.
19
 *
20
 * @author webeweb <https://github.com/webeweb>
21
 * @package WBW\Bundle\JQuery\DataTablesBundle\Tests\Renderer\Strings
22
 */
23
class CenterAlignedTextRendererTraitTest extends AbstractTestCase {
24
25
    /**
26
     * Test renderCenterAlignedText()
27
     *
28
     * @return void
29
     */
30
    public function testRenderCenterAlignedText(): void {
31
32
        $obj = new TestCenterAlignedTextRendererTrait();
33
34
        $this->assertNull($obj->renderCenterAlignedText(null));
0 ignored issues
show
Are you sure the usage of $obj->renderCenterAlignedText(null) targeting WBW\Bundle\JQuery\DataTa...nderCenterAlignedText() seems to always return null.

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.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
35
        $this->assertNull($obj->renderCenterAlignedText(""));
0 ignored issues
show
Are you sure the usage of $obj->renderCenterAlignedText('') targeting WBW\Bundle\JQuery\DataTa...nderCenterAlignedText() seems to always return null.

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.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
36
        $this->assertEquals('<span class="text-center">content</span>', $obj->renderCenterAlignedText("content"));
37
    }
38
}
39