tests-old/data_test.php
Avoid unused local variables such as '$response'. Open
Open
$response = Save_Xml_data($xml, 'data/test1.xml');
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
The method testLoad_default_xml_data is not named in camelCase. Open
Open
function testLoad_default_xml_data()
{
$this->assertTrue(Load_Xml_data('data/data.xml'));
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method testLoad_specific_xml_data is not named in camelCase. Open
Open
function testLoad_specific_xml_data()
{
$this->assertTrue(Load_Xml_data('data/data.xml'));
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method testLoad_wrong_file is not named in camelCase. Open
Open
function testLoad_wrong_file()
{
$this->assertEqual(Load_Xml_data('data/No_file.xml'), 'Failed to load XML');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method testSave_data is not named in camelCase. Open
Open
function testSave_data()
{
include_once 'lib/data.model.php';
$xml = Load_Xml_data('data/test.xml');
$response = Save_Xml_data($xml, 'data/test1.xml');
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}