~tcuthbert/wordpress/openstack-objectstorage

« back to all changes in this revision

Viewing changes to vendor/phpunit/phpunit/tests/_files/DataProviderDebugTest.php

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
class DataProviderDebugTest extends PHPUnit_Framework_TestCase
 
3
{
 
4
    /**
 
5
     * @dataProvider provider
 
6
     */
 
7
    public function testProvider()
 
8
    {
 
9
        $this->assertTrue(true);
 
10
    }
 
11
 
 
12
    public static function provider()
 
13
    {
 
14
        $obj2 = new \stdClass();
 
15
        $obj2->foo = 'bar';
 
16
 
 
17
        $obj3 = (object) array(1,2,"Test\r\n",4,5,6,7,8);
 
18
 
 
19
        $obj = new \stdClass();
 
20
        //@codingStandardsIgnoreStart
 
21
        $obj->null = null;
 
22
        //@codingStandardsIgnoreEnd
 
23
        $obj->boolean = true;
 
24
        $obj->integer = 1;
 
25
        $obj->double = 1.2;
 
26
        $obj->string = '1';
 
27
        $obj->text = "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext";
 
28
        $obj->object = $obj2;
 
29
        $obj->objectagain = $obj2;
 
30
        $obj->array = array('foo' => 'bar');
 
31
        $obj->self = $obj;
 
32
 
 
33
        $storage = new \SplObjectStorage();
 
34
        $storage->attach($obj2);
 
35
        $storage->foo = $obj2;
 
36
 
 
37
        return array(
 
38
            array(null, true, 1, 1.0),
 
39
            array(1.2, fopen('php://memory', 'r'), '1'),
 
40
            array(array(array(1,2,3), array(3,4,5))),
 
41
            // \n\r and \r is converted to \n
 
42
            array("this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext"),
 
43
            array(new \stdClass(), $obj, array(), $storage, $obj3),
 
44
            array(chr(0) . chr(1) . chr(2) . chr(3) . chr(4) . chr(5), implode('', array_map('chr', range(0x0e, 0x1f)))),
 
45
            array(chr(0x00) . chr(0x09))
 
46
        );
 
47
    }
 
48
}