public function FileProfilerStorageTest::testReadLineFromFile

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php, line 86

Class

FileProfilerStorageTest

Namespace

Symfony\Component\HttpKernel\Tests\Profiler

Code

public function testReadLineFromFile() {
  $r = new \ReflectionMethod(self::$storage, 'readLineFromFile');
  $r
    ->setAccessible(true);
  $h = tmpfile();
  fwrite($h, "line1\n\n\nline2\n");
  fseek($h, 0, SEEK_END);
  $this
    ->assertEquals("line2", $r
    ->invoke(self::$storage, $h));
  $this
    ->assertEquals("line1", $r
    ->invoke(self::$storage, $h));
}