add( 'unit-tests', 'this is a message' ); $this->assertStringMatchesFormat( '%d-%d-%d @ %d:%d:%d - %s', $this->read_content( 'unit-tests' ) ); $this->assertStringEndsWith( ' - this is a message' . PHP_EOL, $this->read_content( 'unit-tests' ) ); } /** * Test clear(). * * @since 2.4 */ public function test_clear() { $log = new \WC_Logger(); $log->add( 'unit-tests', 'this is a message' ); $log->clear( 'unit-tests' ); $this->assertEquals( '', $this->read_content( 'unit-tests' ) ); } }