diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-11-30 07:57:16 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-11-30 07:57:16 +0100 |
commit | 23d7e39da0c8b8281b512eea7fe95f441489ab8b (patch) | |
tree | 6348f12f0135468bb0074c8ee4d86eb3a457e1c9 /php-nette-utils-pr91.patch | |
parent | 9f527b093d14801a5b905080b0bc5e1db999719e (diff) |
php-nette-utils: offline patch
Diffstat (limited to 'php-nette-utils-pr91.patch')
-rw-r--r-- | php-nette-utils-pr91.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/php-nette-utils-pr91.patch b/php-nette-utils-pr91.patch new file mode 100644 index 0000000..caea7a8 --- /dev/null +++ b/php-nette-utils-pr91.patch @@ -0,0 +1,51 @@ +From cddddd0fa49f1b0eeb19be18389711222b1a0aee Mon Sep 17 00:00:00 2001 +From: Remi Collet <fedora@famillecollet.com> +Date: Mon, 9 Nov 2015 16:52:13 +0100 +Subject: [PATCH] allow to skip online tests + +--- + tests/Utils/FileSystem.phpt | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +diff --git a/tests/Utils/FileSystem.phpt b/tests/Utils/FileSystem.phpt +index 68871f2..2a0c96c 100644 +--- a/tests/Utils/FileSystem.phpt ++++ b/tests/Utils/FileSystem.phpt +@@ -41,8 +41,13 @@ test(function () { // copy + FileSystem::copy(TEMP_DIR . '/3/file', TEMP_DIR . '/3/x/file'); + Assert::same('Hello', file_get_contents(TEMP_DIR . '/3/x/file')); + +- FileSystem::copy('http://example.com', TEMP_DIR . '/3/x/y/file'); +- Assert::true(is_file(TEMP_DIR . '/3/x/y/file')); ++ if (getenv('SKIP_ONLINE_TESTS') ?: false) { ++ FileSystem::copy(__FILE__, TEMP_DIR . '/3/x/y/file'); ++ Assert::true(is_file(TEMP_DIR . '/3/x/y/file')); ++ } else { ++ FileSystem::copy('http://example.com', TEMP_DIR . '/3/x/y/file'); ++ Assert::true(is_file(TEMP_DIR . '/3/x/y/file')); ++ } + + FileSystem::write(TEMP_DIR . '/5/newfile', 'World'); + +@@ -51,10 +56,17 @@ test(function () { // copy + }, 'Nette\InvalidStateException', "File or directory '%a%' already exists."); + Assert::same('Hello', file_get_contents(TEMP_DIR . '/3/x/file')); + +- Assert::exception(function () { +- FileSystem::copy('http://example.com', TEMP_DIR . '/3/x/file', FALSE); +- }, 'Nette\InvalidStateException', "File or directory '%a%' already exists."); +- Assert::same('Hello', file_get_contents(TEMP_DIR . '/3/x/file')); ++ if (getenv('SKIP_ONLINE_TESTS') ?: false) { ++ Assert::exception(function () { ++ FileSystem::copy(__FILE__, TEMP_DIR . '/3/x/file', FALSE); ++ }, 'Nette\InvalidStateException', "File or directory '%a%' already exists."); ++ Assert::same('Hello', file_get_contents(TEMP_DIR . '/3/x/file')); ++ } else { ++ Assert::exception(function () { ++ FileSystem::copy('http://example.com', TEMP_DIR . '/3/x/file', FALSE); ++ }, 'Nette\InvalidStateException', "File or directory '%a%' already exists."); ++ Assert::same('Hello', file_get_contents(TEMP_DIR . '/3/x/file')); ++ } + + FileSystem::copy(TEMP_DIR . '/5/newfile', TEMP_DIR . '/3/x/file'); + Assert::same('World', file_get_contents(TEMP_DIR . '/3/x/file')); |