Introduce PHP7 strict typing
This commit is contained in:
@@ -44,35 +44,35 @@ class XMPPHP_XMLObjTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testToStringNameNamespace()
|
||||
{
|
||||
$xmlobj = new XMPPHP_XMLObj('testname', 'testNameSpace');
|
||||
$xmlobj = new XMPPHP_XMLObj('testname', 'testNameSpace');
|
||||
$expected = '<testname xmlns="testNameSpace"></testname>';
|
||||
$result = $xmlobj->toString();
|
||||
$result = $xmlobj->toString();
|
||||
$this->assertSame($expected, $result);
|
||||
}
|
||||
|
||||
public function testToStringNameNamespaceAttr()
|
||||
{
|
||||
$xmlobj = new XMPPHP_XMLObj('testName', 'testNameSpace', array('attr1' => 'valA', 'attr2' => 'valB'));
|
||||
$xmlobj = new XMPPHP_XMLObj('testName', 'testNameSpace', ['attr1' => 'valA', 'attr2' => 'valB']);
|
||||
$expected = '<testname xmlns="testNameSpace" attr1="valA" attr2="valB"></testname>';
|
||||
$result = $xmlobj->toString();
|
||||
$result = $xmlobj->toString();
|
||||
$this->assertSame($expected, $result);
|
||||
}
|
||||
|
||||
public function testToStringNameNamespaceData()
|
||||
{
|
||||
$xmlobj = new XMPPHP_XMLObj('testName', 'testNameSpace', array(), 'I am test data');
|
||||
$xmlobj = new XMPPHP_XMLObj('testName', 'testNameSpace', [], 'I am test data');
|
||||
$expected = '<testname xmlns="testNameSpace">I am test data</testname>';
|
||||
$result = $xmlobj->toString();
|
||||
$result = $xmlobj->toString();
|
||||
$this->assertSame($expected, $result);
|
||||
}
|
||||
|
||||
public function testToStringNameNamespaceSub()
|
||||
{
|
||||
$xmlobj = new XMPPHP_XMLObj('testName', 'testNameSpace');
|
||||
$sub1 = new XMPPHP_XMLObj('subName', 'subNameSpace');
|
||||
$xmlobj->subs = array($sub1);
|
||||
$expected = '<testname xmlns="testNameSpace"><subname xmlns="subNameSpace"></subname></testname>';
|
||||
$result = $xmlobj->toString();
|
||||
$xmlobj = new XMPPHP_XMLObj('testName', 'testNameSpace');
|
||||
$sub1 = new XMPPHP_XMLObj('subName', 'subNameSpace');
|
||||
$xmlobj->subs = [$sub1];
|
||||
$expected = '<testname xmlns="testNameSpace"><subname xmlns="subNameSpace"></subname></testname>';
|
||||
$result = $xmlobj->toString();
|
||||
$this->assertSame($expected, $result);
|
||||
}
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ class XMPPHP_XMPPTest extends PHPUnit_Framework_TestCase
|
||||
} catch (XMPPHP_Exception $e) {
|
||||
return;
|
||||
} catch (Exception $e) {
|
||||
$this->fail('Unexpected Exception thrown: '.$e->getMessage());
|
||||
$this->fail('Unexpected Exception thrown: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->fail('Expected XMPPHP_Exception not thrown!');
|
||||
@@ -74,7 +74,7 @@ class XMPPHP_XMPPTest extends PHPUnit_Framework_TestCase
|
||||
} catch (XMPPHP_Exception $e) {
|
||||
return;
|
||||
} catch (Exception $e) {
|
||||
$this->fail('Unexpected Exception thrown: '.$e->getMessage());
|
||||
$this->fail('Unexpected Exception thrown: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->fail('Expected XMPPHP_Exception not thrown!');
|
||||
|
Reference in New Issue
Block a user