From 26ce51d6f19af1a285b3d3f32e92cdf8cf86ab72 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sun, 1 Mar 2009 07:16:46 +0000 Subject: [PATCH] add safeguard check for timestamp modification to phar_stub.phpt and phar_gzip.phpt --- ext/phar/tests/phar_gzip.phpt | 5 +++++ ext/phar/tests/zip/phar_stub.phpt | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ext/phar/tests/phar_gzip.phpt b/ext/phar/tests/phar_gzip.phpt index 99ff22d7bc8..c722834ba6c 100644 --- a/ext/phar/tests/phar_gzip.phpt +++ b/ext/phar/tests/phar_gzip.phpt @@ -42,6 +42,11 @@ $a->setAlias('another'); $b = new Phar($fname2); var_dump($b->isFileFormat(Phar::PHAR)); var_dump($b->isCompressed() == Phar::GZ); +$a = stat($pname . '/test'); +$b = stat($pname2 . '/test'); +if ($a['mtime'] != $b['mtime']) { + echo "timestamp changed, was $a[mtime], now $b[mtime]!\n"; +} ?> ===DONE=== --CLEAN-- diff --git a/ext/phar/tests/zip/phar_stub.phpt b/ext/phar/tests/zip/phar_stub.phpt index 72c1f17d786..302a894d76a 100644 --- a/ext/phar/tests/zip/phar_stub.phpt +++ b/ext/phar/tests/zip/phar_stub.phpt @@ -19,6 +19,12 @@ $p['b'] = 'b'; $p['c'] = 'c'; copy($fname2, $fname); +$a = stat($pname . '/a'); +$b = stat($pname2 . '/a'); +if ($a['mtime'] != $b['mtime']) { + echo "timestamp changed, was $a[mtime], now $b[mtime]!\n"; +} + $phar = new Phar($fname); echo $phar->getStub();