Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
OutputBambooTest.php
Go to the documentation of this file.
1 <?php
7 
11 require_once __DIR__ . '/OutputBambooTestFilter.php';
12 class OutputBambooTest extends \PHPUnit\Framework\TestCase
13 {
17  protected $_output;
18 
19  public static function setUpBeforeClass()
20  {
21  stream_filter_register('dataCollectorFilter', \Magento\Test\Profiler\OutputBambooTestFilter::class);
22  }
23 
27  protected function setUp()
28  {
30 
34  $this->_output = new \Magento\TestFramework\Profiler\OutputBamboo(
35  [
36  'filePath' => 'php://filter/write=dataCollectorFilter/resource=php://memory',
37  'metrics' => ['sample metric (ms)' => ['profiler_key_for_sample_metric']],
38  ]
39  );
40  }
41 
42  public function testDisplay()
43  {
44  $this->_output->display(new \Magento\Framework\Profiler\Driver\Standard\Stat());
45  \Magento\Test\Profiler\OutputBambooTestFilter::assertCollectedData("Timestamp,\"sample metric (ms)\"\n%d,%d");
46  }
47 }
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60