Differential D21678 Diff 51616 src/applications/calendar/parser/ics/__tests__/PhutilICSWriterTestCase.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/parser/ics/__tests__/PhutilICSWriterTestCase.php
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | final class PhutilICSWriterTestCase extends PhutilTestCase { | ||||
private function writeICS(PhutilCalendarRootNode $root) { | private function writeICS(PhutilCalendarRootNode $root) { | ||||
return id(new PhutilICSWriter()) | return id(new PhutilICSWriter()) | ||||
->writeICSDocument($root); | ->writeICSDocument($root); | ||||
} | } | ||||
private function assertICS($name, $actual) { | private function assertICS($name, $actual) { | ||||
$path = dirname(__FILE__).'/data/'.$name; | $path = dirname(__FILE__).'/data/'.$name; | ||||
$data = Filesystem::readFile($path); | $data = Filesystem::readFile($path); | ||||
$data = str_replace( | |||||
'${PRODID}', | |||||
PhutilICSWriter::getICSPRODID(), | |||||
$data); | |||||
$this->assertEqual($data, $actual, pht('ICS: %s', $name)); | $this->assertEqual($data, $actual, pht('ICS: %s', $name)); | ||||
} | } | ||||
} | } |