1
- <?php namespace Scriptotek \Tests ;
1
+ <?php namespace Scriptotek \Sru ;
2
2
3
3
use \Guzzle \Http \Message \Response as HttpResponse ;
4
4
use \Mockery as m ;
5
- use \Scriptotek \Sru \Client as SruClient ;
6
5
7
6
class ClientTest extends TestCase {
8
7
@@ -14,14 +13,14 @@ class ClientTest extends TestCase {
14
13
15
14
public function testUrlTo ()
16
15
{
17
- $ sru1 = new SruClient ($ this ->url );
16
+ $ sru1 = new Client ($ this ->url );
18
17
$ expectedUrl1 = $ this ->url . '?version=1.1&operation=searchRetrieve&recordSchema=marcxml&maximumRecords=10&query=isbn%3D123 ' ;
19
18
$ expectedUrl2 = $ this ->url . '?version=1.1&operation=searchRetrieve&recordSchema=marcxml&maximumRecords=50&query=isbn%3D123&startRecord=2 ' ;
20
19
21
- $ sru3 = new SruClient ($ this ->url , array ('schema ' => 'CUSTOMSCHEMA ' ));
20
+ $ sru3 = new Client ($ this ->url , array ('schema ' => 'CUSTOMSCHEMA ' ));
22
21
$ expectedUrl3 = $ this ->url . '?version=1.1&operation=searchRetrieve&recordSchema=CUSTOMSCHEMA&maximumRecords=10&query=isbn%3D123 ' ;
23
22
24
- $ sru4 = new SruClient ($ this ->url , array ('version ' => '0.9 ' ));
23
+ $ sru4 = new Client ($ this ->url , array ('version ' => '0.9 ' ));
25
24
$ expectedUrl4 = $ this ->url . '?version=0.9&operation=searchRetrieve&recordSchema=marcxml&maximumRecords=10&query=isbn%3D123 ' ;
26
25
27
26
$ this ->assertEquals ($ expectedUrl1 , $ sru1 ->urlTo ('isbn=123 ' ));
@@ -33,7 +32,7 @@ public function testUrlTo()
33
32
public function testSearch ()
34
33
{
35
34
$ http = $ this ->basicHttpMock ($ this ->simple_response );
36
- $ sru = new SruClient ($ this ->url , null , $ http );
35
+ $ sru = new Client ($ this ->url , null , $ http );
37
36
38
37
$ this ->assertXmlStringEqualsXmlString (
39
38
$ this ->simple_response ,
@@ -59,7 +58,7 @@ public function testSearchWithAuth()
59
58
$ options = array (
60
59
'credentials ' => $ credentials
61
60
);
62
- $ sru = new SruClient ($ this ->url , $ options , $ http );
61
+ $ sru = new Client ($ this ->url , $ options , $ http );
63
62
64
63
$ sru ->search ('test ' );
65
64
}
0 commit comments