/** * Check the format of the VCARD skeleton (begin, end, version), * remove those lines, and return the remaining lines (sorted). * Utility for use in __toString() tests. * @arg $vcard_string The vcard output to check * @return An array of the remaining lines (no newlines). */ public function checkAndRemoveSkeleton($vcard_string) { $lines = explode("\n", VCardParser::unfold4($vcard_string)); $this->assertGreaterThan(4, count($lines)); $line = array_pop($lines); $this->assertEmpty($line); $line = array_pop($lines); $this->assertEquals(self::$vcard_end, $line); $line = array_shift($lines); $this->assertEquals(self::$vcard_begin, $line); $line = array_shift($lines); $this->assertEquals(self::$vcard_version, $line); sort($lines); return $lines; }