From 28a202ee9e181958bf11e3c044dc4a3b7397849d Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Sat, 29 Nov 2014 20:18:23 +0200 Subject: [PATCH] simplify --- test/commonmark/CommonMarkTest.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/commonmark/CommonMarkTest.php b/test/commonmark/CommonMarkTest.php index a2b404f..afc61f5 100644 --- a/test/commonmark/CommonMarkTest.php +++ b/test/commonmark/CommonMarkTest.php @@ -10,23 +10,17 @@ */ class CommonMarkTest extends PHPUnit_Framework_TestCase { - const SPEC_FILEPATH = 'spec.txt'; - const SPEC_URL = 'https://raw.githubusercontent.com/jgm/stmd/master/spec.txt'; public function getCommonMarkRules() { - if (is_file(self::SPEC_FILEPATH) and is_readable(self::SPEC_FILEPATH)) { - $spec = file_get_contents(self::SPEC_FILEPATH); - } else { - $spec = file_get_contents(self::SPEC_URL); - } + $spec = file_get_contents(self::SPEC_URL); $tests = array(); $testsCount = 0; $currentSection = ''; - $spec = preg_replace('/^(.|[\n])*/m', '', $spec); + $spec = strstr($spec, '', true); preg_replace_callback( '/^\.\n([\s\S]*?)^\.\n([\s\S]*?)^\.$|^#{1,6} *(.*)$/m',