1
0
mirror of https://github.com/halaxa/json-machine.git synced 2025-07-26 08:50:38 +02:00
Files
json-machine/test/JsonMachineTest/FunctionsTest.php

28 lines
594 B
PHP

<?php
namespace JsonMachineTest;
use function JsonMachine\objects;
class FunctionsTest extends \PHPUnit_Framework_TestCase
{
/**
* @dataProvider dataObjectsOnEmptyInput
* @param $expected
* @param $data
*/
public function testObjectsOnEmptyInput($expected, $data)
{
$this->assertEquals($expected, iterator_to_array(objects($data)));
}
public function dataObjectsOnEmptyInput()
{
return [
[[], []],
[[new \stdClass()], [[]]],
[[(object)["one" => "two"]], [["one" => "two"]]],
];
}
}