3 require_once 'plugins/wallabag/WallabagInstance.php';
6 * Class WallabagInstanceTest
8 class WallabagInstanceTest
extends PHPUnit_Framework_TestCase
11 * @var string wallabag url.
20 $this->instance
= 'http://some.url';
24 * Test WallabagInstance with API V1.
26 function testWallabagInstanceV1()
28 $instance = new WallabagInstance($this->instance
, 1);
29 $expected = $this->instance
. '/?plainurl=';
30 $result = $instance->getWallabagUrl();
31 $this->assertEquals($expected, $result);
35 * Test WallabagInstance with API V2.
37 function testWallabagInstanceV2()
39 $instance = new WallabagInstance($this->instance
, 2);
40 $expected = $this->instance
. '/bookmarklet?url=';
41 $result = $instance->getWallabagUrl();
42 $this->assertEquals($expected, $result);
46 * Test WallabagInstance with an invalid API version.
48 function testWallabagInstanceInvalidVersion()
50 $instance = new WallabagInstance($this->instance
, false);
51 $expected = $this->instance
. '/?plainurl=';
52 $result = $instance->getWallabagUrl();
53 $this->assertEquals($expected, $result);
55 $instance = new WallabagInstance($this->instance
, 3);
56 $expected = $this->instance
. '/?plainurl=';
57 $result = $instance->getWallabagUrl();
58 $this->assertEquals($expected, $result);