Skip to content

Commit c94c6da

Browse files
author
Frank Evers
committed
Merge branch 'master' of github.com:tinify/wordpress-plugin
2 parents aa0f92d + 4dc9b6d commit c94c6da

3 files changed

Lines changed: 8 additions & 15 deletions

File tree

config/Dockerfile-phantomjs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
FROM ubuntu:14.04
1+
FROM servebox/phantomjs:latest
22

33
EXPOSE 8910
44

5-
ENV PHANTOM_JS_VERSION 1.9.7-linux-x86_64
6-
7-
RUN apt-get update
8-
RUN apt-get install -yqq curl libfreetype6 libfontconfig
9-
# make ruby python git g++ flex bison gperf perl \
10-
# libfontconfig1-dev libicu-dev libfreetype6 \
11-
# libssl-dev libpng-dev libjpeg-dev
12-
# RUN git clone git://github.com/ariya/phantomjs.git && cd phantomjs && ./build.sh && send "y\n"
13-
14-
RUN curl -sSL https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOM_JS_VERSION.tar.bz2 | tar xjC /
15-
RUN ln -s phantomjs-$PHANTOM_JS_VERSION /phantomjs
16-
17-
CMD ["/phantomjs/bin/phantomjs", "--webdriver=8910"]
5+
CMD ["phantomjs", "--webdriver=8910"]

test/unit/TinyPluginTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function testCompressShouldUpdateMetadata() {
115115

116116
$metadata = $this->wp->getMetadata(1, 'tiny_compress_images', true);
117117
foreach ($metadata as $key => $values) {
118-
$this->assertEquals(time(), $values['end'], 2);
118+
$this->assertBetween(-1, +1, $values['end'] - time());
119119
unset($metadata[$key]['end']);
120120
unset($metadata[$key]['start']);
121121
}

test/unit/TinyTestCase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@ protected function setUp() {
2727

2828
protected function tearDown() {
2929
}
30+
31+
protected function assertBetween($lower_bound, $upper_bound, $actual, $message='') {
32+
$this->assertGreaterThanOrEqual($lower_bound, $actual, $message);
33+
$this->assertLessThanOrEqual($upper_bound, $actual, $message);
34+
}
3035
}

0 commit comments

Comments
 (0)