getName() public method

public getName ( )
Exemplo n.º 1
0
 public function testDump()
 {
     $data = new Data(array(array(123)));
     $collector = new DumpDataCollector();
     $this->assertSame('dump', $collector->getName());
     $collector->dump($data);
     $line = __LINE__;
     $this->assertSame(1, $collector->getDumpsCount());
     $dump = $collector->getDumps('html');
     $this->assertTrue(isset($dump[0]['data']));
     $dump[0]['data'] = preg_replace('/^.*?<pre/', '<pre', $dump[0]['data']);
     $xDump = array(array('data' => "<pre class=sf-dump><span class=sf-dump-num>123</span>\n</pre><script>Sfdump.instrument()</script>\n", 'name' => 'DumpDataCollectorTest.php', 'file' => __FILE__, 'line' => $line, 'fileExcerpt' => false));
     $this->assertSame($xDump, $dump);
     $this->assertStringStartsWith('a:1:{i:0;a:5:{s:4:"data";O:39:"Symfony\\Component\\VarDumper\\Cloner\\Data":3:{s:45:"Symfony\\Component\\VarDumper\\Cloner\\Datadata";a:1:{i:0;a:1:{i:0;i:123;}}s:49:"Symfony\\Component\\VarDumper\\Cloner\\DatamaxDepth";i:-1;s:57:"Symfony\\Component\\VarDumper\\Cloner\\DatamaxItemsPerDepth";i:-1;}s:4:"name";s:25:"DumpDataCollectorTest.php";s:4:"file";s:', str_replace("", '', $collector->serialize()));
     $this->assertSame(0, $collector->getDumpsCount());
     $this->assertSame('a:0:{}', $collector->serialize());
 }
 public function testDump()
 {
     $data = new Data(array(array(123)));
     $collector = new DumpDataCollector();
     $this->assertSame('dump', $collector->getName());
     $collector->dump($data);
     $line = __LINE__ - 1;
     $this->assertSame(1, $collector->getDumpsCount());
     $dump = $collector->getDumps('html');
     $this->assertTrue(isset($dump[0]['data']));
     $dump[0]['data'] = preg_replace('/^.*?<pre/', '<pre', $dump[0]['data']);
     $dump[0]['data'] = preg_replace('/sf-dump-\\d+/', 'sf-dump', $dump[0]['data']);
     $xDump = array(array('data' => "<pre class=sf-dump id=sf-dump data-indent-pad=\"  \"><span class=sf-dump-num>123</span>\n</pre><script>Sfdump(\"sf-dump\")</script>\n", 'name' => 'DumpDataCollectorTest.php', 'file' => __FILE__, 'line' => $line, 'fileExcerpt' => false));
     $this->assertSame($xDump, $dump);
     $this->assertStringMatchesFormat('a:1:{i:0;a:5:{s:4:"data";O:39:"Symfony\\Component\\VarDumper\\Cloner\\Data":4:{s:45:"Symfony\\Component\\VarDumper\\Cloner\\Datadata";a:1:{i:0;a:1:{i:0;i:123;}}s:49:"Symfony\\Component\\VarDumper\\Cloner\\DatamaxDepth";i:%i;s:57:"Symfony\\Component\\VarDumper\\Cloner\\DatamaxItemsPerDepth";i:%i;s:54:"Symfony\\Component\\VarDumper\\Cloner\\DatauseRefHandles";i:%i;}s:4:"name";s:25:"DumpDataCollectorTest.php";s:4:"file";s:%a', str_replace("", '', $collector->serialize()));
     $this->assertSame(0, $collector->getDumpsCount());
     $this->assertSame('a:0:{}', $collector->serialize());
 }
Exemplo n.º 3
0
 public function testDump()
 {
     $data = new Data(array(array(123)));
     $collector = new DumpDataCollector();
     $this->assertSame('dump', $collector->getName());
     $collector->dump($data);
     $line = __LINE__ - 1;
     $this->assertSame(1, $collector->getDumpsCount());
     $dump = $collector->getDumps('html');
     $this->assertTrue(isset($dump[0]['data']));
     $dump[0]['data'] = preg_replace('/^.*?<pre/', '<pre', $dump[0]['data']);
     $dump[0]['data'] = preg_replace('/sf-dump-\\d+/', 'sf-dump', $dump[0]['data']);
     $xDump = array(array('data' => "<pre class=sf-dump id=sf-dump data-indent-pad=\"  \"><span class=sf-dump-num>123</span>\n</pre><script>Sfdump(\"sf-dump\")</script>\n", 'name' => 'DumpDataCollectorTest.php', 'file' => __FILE__, 'line' => $line, 'fileExcerpt' => false));
     $this->assertEquals($xDump, $dump);
     $this->assertStringMatchesFormat('a:3:{i:0;a:5:{s:4:"data";O:39:"Symfony\\Component\\VarDumper\\Cloner\\Data":%a', $collector->serialize());
     $this->assertSame(0, $collector->getDumpsCount());
     $this->assertSame('a:2:{i:0;b:0;i:1;s:5:"UTF-8";}', $collector->serialize());
 }