for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Superdesk Web Publisher Templates System
*
* Copyright 2015 Sourcefabric z.u. and contributors.
* For the full copyright and license information, please see the
* AUTHORS and LICENSE files distributed with this source code.
* @copyright 2015 Sourcefabric z.ú.
* @license http://www.superdesk.org/license
*/
namespace SWP\TemplatesSystem\Tests\Gimme\Container;
use SWP\TemplatesSystem\Tests\Gimme\Model\Widget;
use SWP\TemplatesSystem\Gimme\Widget\HtmlWidget;
class HtmlWidgetTest extends \PHPUnit_Framework_TestCase
{
private $container;
$container
This check marks private properties in classes that are never used. Those properties can be removed.
public function setUp()
$widgetEntity = new Widget();
$widgetEntity->setId(1);
$widgetEntity->setParameters(['html_body' => 'simple html body']);
$this->widget = new HtmlWidget($widgetEntity);
widget
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
public function testcheckingVisibility()
$this->assertTrue($this->widget->isVisible());
public function testRendering()
$this->assertEquals($this->widget->render(), 'simple html body');
This check marks private properties in classes that are never used. Those properties can be removed.