PHP Classes

File: tests/objectForeachTest.php

Recommend this page to a friend!
  Classes of Rick Hambrook  >  Nest  >  tests/objectForeachTest.php  >  Download  
File: tests/objectForeachTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test: object foreach
Class: Nest
Easily set and get values of nested arrays
Author: By
Last change: feat(meta): update namespaces and add composer file for composer/packagist support
Date: 6 years ago
Size: 671 bytes


Class file image Download

require_once(implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "src", "Nest.php"]));

use \
Hambrook\Nest\Nest as Nest;

 * Tests for PHPUnit
 * @author Rick Hambrook <>
 * @copyright 2015 Rick Hambrook
 * @license GNU General Public License v3
class objectForeachTest extends PHPUnit_Framework_TestCase {

    public function
testForeachIndexed() {
$Nest = new Nest(new testObjectForeachData);
$tmp = "";
        foreach (
$Nest as $t) {
$tmp .= $t;
$this->assertEquals("abc", $tmp);


testObjectForeachData {
$one = "a";
$two = "b";
$three = "c";

For more information send a message to info at phpclasses dot org.