mirror of
https://github.com/openclassify/openclassify.git
synced 2026-04-19 21:43:30 -05:00
40 lines
964 B
PHP
40 lines
964 B
PHP
<?php
|
|
/**
|
|
* This file is part of library-template
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*
|
|
* @author Nicolò Martini <nicmartnic@gmail.com>
|
|
*/
|
|
|
|
namespace StringTemplate\Test;
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use StringTemplate\RecursiveArrayOnlyIterator;
|
|
|
|
class RecursiveArrayOnlyIteratorTest extends TestCase
|
|
{
|
|
public function testHasChildrenWithScalarValue()
|
|
{
|
|
$it = new RecursiveArrayOnlyIterator(array('a' => 'b'));
|
|
|
|
$this->assertFalse($it->hasChildren());
|
|
}
|
|
|
|
public function testHasChildrenWithArrayValue()
|
|
{
|
|
$it = new RecursiveArrayOnlyIterator(array('a' => array()));
|
|
|
|
$this->assertTrue($it->hasChildren());
|
|
}
|
|
|
|
public function testHasChildrenWithObjectValue()
|
|
{
|
|
$it = new RecursiveArrayOnlyIterator(array('a' => new \stdClass()));
|
|
|
|
$this->assertFalse($it->hasChildren());
|
|
}
|
|
}
|
|
|