xxxxxxxxxx
namespace WsdlToPhp\PackageBase\Tests;
class StructBaseTest extends TestCase
{
/**
*
*/
public function testSetState()
{
$object = new StructObject();
$object
->setBar('foo')
->setFoo('bar');
$this->assertEquals($object, StructObject::__set_state(array(
'bar' => 'foo',
'foo' => 'bar',
)));
}
/**
* @expectedException \InvalidArgumentException
*/
public function testSetStateException()
{
StructObject::__set_state(array(
'bar' => 'foo',
'foo' => 'bar',
'sample' => 'data',
));
}
/**
*
*/
public function testSetGet()
{
$object = new StructObject();
$object
->setBar('foo')
->setFoo('bar');
$this->assertSame('foo', $object->_get('bar'));
}
/**
* @expectedException \InvalidArgumentException
*/
public function testSetGetWithException()
{
$object = new StructObject();
$object
->setBar('foo')
->setFoo('bar');
$object->_get('sample');
}
public function testJsonSerialize()
{
$object = new StructObject();
$object
->setBar('foo')
->setFoo('bar');
$this->assertSame([
'foo' => 'bar',
'bar' => 'foo',
], $object->jsonSerialize());
}
/**
*
*/
public function test__toStringMustReturnTheClassNameOfTheInstance()
{
$this->assertSame('WsdlToPhp\PackageBase\Tests\StructObject', (string) new StructObject());
}
}
Don't be shy, don't hesitate to contact us for any subject, we'll be glad to help.
This platform is provided to give developpers and non developpers a way to easily consume SOAP Web Services or share their own SOAP Web Services with extra features powered by the platform.
© 2024 Providr.IO