diff --git a/tests/NorthslopePL/Metassione/Tests/EmptyKlass.php b/tests/NorthslopePL/Metassione/Tests/EmptyKlass.php deleted file mode 100644 index 1e439f5..0000000 --- a/tests/NorthslopePL/Metassione/Tests/EmptyKlass.php +++ /dev/null @@ -1,6 +0,0 @@ -value = $value; + } + + /** + * @return \NorthslopePL\Metassione\Tests\Examples\OnePropertyKlass + */ + public function getValue() + { + return $this->value; + } + +} diff --git a/tests/NorthslopePL/Metassione/Tests/OnePropertyKlass.php b/tests/NorthslopePL/Metassione/Tests/Examples/OnePropertyKlass.php similarity index 83% rename from tests/NorthslopePL/Metassione/Tests/OnePropertyKlass.php rename to tests/NorthslopePL/Metassione/Tests/Examples/OnePropertyKlass.php index 81bfbdd..ca46181 100644 --- a/tests/NorthslopePL/Metassione/Tests/OnePropertyKlass.php +++ b/tests/NorthslopePL/Metassione/Tests/Examples/OnePropertyKlass.php @@ -1,5 +1,5 @@ value = $value; - } - - /** - * @return \NorthslopePL\Metassione\Tests\OnePropertyKlass - */ - public function getValue() - { - return $this->value; - } - -} diff --git a/tests/NorthslopePL/Metassione/Tests/POPOConverterTest.php b/tests/NorthslopePL/Metassione/Tests/POPOConverterTest.php index 434ef28..65225d3 100644 --- a/tests/NorthslopePL/Metassione/Tests/POPOConverterTest.php +++ b/tests/NorthslopePL/Metassione/Tests/POPOConverterTest.php @@ -2,6 +2,10 @@ namespace NorthslopePL\Metassione\Tests; use NorthslopePL\Metassione\POPOConverter; +use NorthslopePL\Metassione\Tests\Examples\ArrayedKlass; +use NorthslopePL\Metassione\Tests\Examples\EmptyKlass; +use NorthslopePL\Metassione\Tests\Examples\OnePropertyKlass; +use NorthslopePL\Metassione\Tests\Examples\SimpleKlass; class POPOConverterTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/NorthslopePL/Metassione/Tests/POPOObjectFillerTest.php b/tests/NorthslopePL/Metassione/Tests/POPOObjectFillerTest.php index 3ca4f21..7ff968e 100644 --- a/tests/NorthslopePL/Metassione/Tests/POPOObjectFillerTest.php +++ b/tests/NorthslopePL/Metassione/Tests/POPOObjectFillerTest.php @@ -3,6 +3,12 @@ use NorthslopePL\Metassione\POPOObjectFiller; use NorthslopePL\Metassione\Tests\Blog\Blog; +use NorthslopePL\Metassione\Tests\Examples\ArrayedKlass; +use NorthslopePL\Metassione\Tests\Examples\EmptyKlass; +use NorthslopePL\Metassione\Tests\Examples\OneObjectPropertyKlass; +use NorthslopePL\Metassione\Tests\Examples\OnePropertyKlass; +use NorthslopePL\Metassione\Tests\Examples\PropertyNotFoundKlass; +use NorthslopePL\Metassione\Tests\Examples\SimpleKlass; class POPOObjectFillerTest extends \PHPUnit_Framework_TestCase { @@ -91,7 +97,7 @@ public function testFillingSimpleObjectWithRawDataThatIsNotAnObject() $simpleObject = new SimpleKlass(); $rawData = 'foobar'; - $this->setExpectedException('NorthslopePL\Metassione\ObjectFillingException', 'Raw data should be an object, but string was given. I was trying to fill object of class NorthslopePL\Metassione\Tests\SimpleKlass.'); + $this->setExpectedException('NorthslopePL\Metassione\ObjectFillingException', 'Raw data should be an object, but string was given. I was trying to fill object of class NorthslopePL\Metassione\Tests\Examples\SimpleKlass.'); $this->objectFiller->fillObjectWithRawData($simpleObject, $rawData); } @@ -102,7 +108,7 @@ public function testFillingObjectWhenItsPropertysClassDoesNotExist() $rawData = new \stdClass(); $rawData->foo = 'bar'; - $this->setExpectedException('NorthslopePL\Metassione\ObjectFillingException', 'Class "NorthslopePL\Metassione\Tests\Foo" does not exist for property NorthslopePL\Metassione\Tests\PropertyNotFoundKlass::$foo'); + $this->setExpectedException('NorthslopePL\Metassione\ObjectFillingException', 'Class "NorthslopePL\Metassione\Tests\Examples\Foo" does not exist for property NorthslopePL\Metassione\Tests\Examples\PropertyNotFoundKlass::$foo'); $this->objectFiller->fillObjectWithRawData($targetObject, $rawData); } @@ -167,7 +173,7 @@ public function testFillingObjectWithIncorrectlyDocumentedArrayProperty() } $rawData->invalidSpecificationForObjects = array($object1, $object2); - $this->setExpectedException('NorthslopePL\Metassione\ObjectFillingException', 'Raw data should be an object, but array was given. I was trying to fill object of class NorthslopePL\Metassione\Tests\OnePropertyKlass. Maybe you have forgotten about adding "array|" for property that holds this class NorthslopePL\Metassione\Tests\OnePropertyKlass'); + $this->setExpectedException('NorthslopePL\Metassione\ObjectFillingException', 'Raw data should be an object, but array was given. I was trying to fill object of class NorthslopePL\Metassione\Tests\Examples\OnePropertyKlass. Maybe you have forgotten about adding "array|" for property that holds this class NorthslopePL\Metassione\Tests\Examples\OnePropertyKlass'); $this->objectFiller->fillObjectWithRawData($targetObject, $rawData); } @@ -188,7 +194,7 @@ public function testUsingUnqalifiedClassname() $sourceData = new \stdClass(); $sourceData->one = (object)array('value' => 42); - $this->setExpectedException('NorthslopePL\Metassione\ObjectFillingException', 'Class "OnePropertyKlass" does not exist for property NorthslopePL\Metassione\Tests\PropertyNotFoundKlass::$one. Maybe you have forgotten to use fully qualified class name (with namespace, example: \Foo\Bar\OnePropertyKlass)?'); + $this->setExpectedException('NorthslopePL\Metassione\ObjectFillingException', 'Class "OnePropertyKlass" does not exist for property NorthslopePL\Metassione\Tests\Examples\PropertyNotFoundKlass::$one. Maybe you have forgotten to use fully qualified class name (with namespace, example: \Foo\Bar\OnePropertyKlass)?'); $this->objectFiller->fillObjectWithRawData($targetObject, $sourceData); } }