4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\VarDumper\Tests\Caster;
14 use Symfony\Component\VarDumper\Test\VarDumperTestCase;
17 * @author Grégoire Pineau <lyrixx@lyrixx.info>
19 class SplCasterTest extends VarDumperTestCase
21 public function getCastFileInfoTests()
24 array(__FILE__, <<<'EOTXT'
27 filename: "SplCasterTest.php"
28 basename: "SplCasterTest.php"
29 pathname: "%sSplCasterTest.php"
31 realPath: "%sSplCasterTest.php"
32 aTime: %s-%s-%d %d:%d:%d
33 mTime: %s-%s-%d %d:%d:%d
34 cTime: %s-%s-%d %d:%d:%d
50 array('https://google.com/about', <<<'EOTXT'
52 %Apath: "https://google.com"
55 pathname: "https://google.com/about"
64 /** @dataProvider getCastFileInfoTests */
65 public function testCastFileInfo($file, $dump)
67 $this->assertDumpMatchesFormat($dump, new \SplFileInfo($file));
70 public function testCastFileObject()
72 $var = new \SplFileObject(__FILE__);
73 $var->setFlags(\SplFileObject::DROP_NEW_LINE | \SplFileObject::SKIP_EMPTY);
77 filename: "SplCasterTest.php"
78 basename: "SplCasterTest.php"
79 pathname: "%sSplCasterTest.php"
81 realPath: "%sSplCasterTest.php"
82 aTime: %s-%s-%d %d:%d:%d
83 mTime: %s-%s-%d %d:%d:%d
84 cTime: %s-%s-%d %d:%d:%d
97 %AcsvControl: array:%d [
101 flags: DROP_NEW_LINE|SKIP_EMPTY
116 $this->assertDumpMatchesFormat($dump, $var);
120 * @dataProvider provideCastSplDoublyLinkedList
122 public function testCastSplDoublyLinkedList($modeValue, $modeDump)
124 $var = new \SplDoublyLinkedList();
125 $var->setIteratorMode($modeValue);
127 SplDoublyLinkedList {
132 $this->assertDumpMatchesFormat($dump, $var);
135 public function provideCastSplDoublyLinkedList()
138 array(\SplDoublyLinkedList::IT_MODE_FIFO, 'IT_MODE_FIFO | IT_MODE_KEEP'),
139 array(\SplDoublyLinkedList::IT_MODE_LIFO, 'IT_MODE_LIFO | IT_MODE_KEEP'),
140 array(\SplDoublyLinkedList::IT_MODE_FIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_FIFO | IT_MODE_DELETE'),
141 array(\SplDoublyLinkedList::IT_MODE_LIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_LIFO | IT_MODE_DELETE'),