You are here

public function JsonLogTest::testGetCorrectFilename in JSONlog 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/JsonLogTest.php \Drupal\Tests\jsonlog\Unit\JsonLogTest::testGetCorrectFilename()
  2. 3.x tests/src/Unit/JsonLogTest.php \Drupal\Tests\jsonlog\Unit\JsonLogTest::testGetCorrectFilename()

test correct filename can be constructed

File

tests/src/Unit/JsonLogTest.php, line 111

Class

JsonLogTest
Unit tests for JsonLog class

Namespace

Drupal\Tests\jsonlog\Unit

Code

public function testGetCorrectFilename() {
  $time = date(self::DEFAULT_TIME_FORMAT);
  $filename = $this->jsonLogger
    ->getFileName(self::DEFAULT_TIME_FORMAT);
  $this
    ->assertEquals(self::DEFAULT_LOG_DIR . '/' . self::DEFAULT_SITE_ID . '.' . $time . '.json.log', $filename, 'Correct filename constructed.');
}