diff options
author | James Valleroy <jvalleroy@mailbox.org> | 2017-06-14 21:57:41 -0400 |
---|---|---|
committer | James Valleroy <jvalleroy@mailbox.org> | 2017-06-14 21:57:44 -0400 |
commit | 947cc50b24843a1e9908b285ffa30e653e36cc7f (patch) | |
tree | 413360be1f3aa8d703ec6cf0c8dbbfc347aeb67c | |
parent | ae18b7730eceb19347fd3d1689afd87c030376bb (diff) | |
download | KLogger-947cc50b24843a1e9908b285ffa30e653e36cc7f.zip KLogger-947cc50b24843a1e9908b285ffa30e653e36cc7f.tar.gz KLogger-947cc50b24843a1e9908b285ffa30e653e36cc7f.tar.bz2 |
Fix one more issue in test
When reading the last line of the test log, if we move beyond the
beginning of the file, that means the file contains only one
line. Rewind the file to ensure the full contents are returned.
-rw-r--r-- | tests/LoggerTest.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/LoggerTest.php b/tests/LoggerTest.php index d2c55ad..d6f7c4a 100644 --- a/tests/LoggerTest.php +++ b/tests/LoggerTest.php @@ -71,7 +71,8 @@ class LoggerTest extends PHPUnit_Framework_TestCase fseek($fp, $pos, SEEK_END); $t = fgetc($fp); $pos = $pos - 1; - if ($size + $pos < 1) { + if ($size + $pos < -1) { + rewind($fp); break; } } |