|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Redmine\Tests; |
| 4 | + |
| 5 | +use Redmine\TestUrlClient; |
| 6 | + |
| 7 | +class UrlTest extends \PHPUnit_Framework_TestCase |
| 8 | +{ |
| 9 | + private $client; |
| 10 | + |
| 11 | + public function setup() |
| 12 | + { |
| 13 | + $this->client = new TestUrlClient('http://test.local', 'asdf'); |
| 14 | + } |
| 15 | + |
| 16 | + public function testWiki() |
| 17 | + { |
| 18 | + $res = $this->client->api('wiki')->create('testProject', 'about', array( |
| 19 | + 'text' => 'asdf', |
| 20 | + 'comments' => 'asdf', |
| 21 | + 'version' => 'asdf', |
| 22 | + )); |
| 23 | + $this->assertEquals($res, array('path' => '/projects/testProject/wiki/about.xml', 'method' => 'PUT')); |
| 24 | + |
| 25 | + $res = $this->client->api('wiki')->update('testProject', 'about', array( |
| 26 | + 'text' => 'asdf', |
| 27 | + 'comments' => 'asdf', |
| 28 | + 'version' => 'asdf', |
| 29 | + )); |
| 30 | + $this->assertEquals($res, array('path' => '/projects/testProject/wiki/about.xml', 'method' => 'PUT')); |
| 31 | + |
| 32 | + $res = $this->client->api('wiki')->show('testProject', 'about'); |
| 33 | + $this->assertEquals($res, array('path' => '/projects/testProject/wiki/about.json', 'method' => 'GET')); |
| 34 | + |
| 35 | + $res = $this->client->api('wiki')->show('testProject', 'about', 'v1'); |
| 36 | + $this->assertEquals($res, array('path' => '/projects/testProject/wiki/about/v1.json', 'method' => 'GET')); |
| 37 | + |
| 38 | + $res = $this->client->api('wiki')->remove('testProject', 'about'); |
| 39 | + $this->assertEquals($res, array('path' => '/projects/testProject/wiki/about.xml', 'method' => 'DELETE')); |
| 40 | + } |
| 41 | +} |
0 commit comments