66
77class ListFeedTest extends TestBase
88{
9+ private $ listFeed ;
10+
11+ public function setUp ()
12+ {
13+ $ this ->listFeed = new ListFeed ($ this ->getSimpleXMLElement ("list-feed " ));
14+ }
15+
16+ public function tearDown ()
17+ {
18+ $ this ->listFeed = null ;
19+ }
20+
921 public function testGetXml ()
1022 {
11- $ feed = new ListFeed ($ this ->getSimpleXMLElement ("list-feed " ));
12- $ this ->assertTrue ($ feed ->getXml () instanceof \SimpleXMLElement);
23+ $ this ->assertTrue ($ this ->listFeed ->getXml () instanceof \SimpleXMLElement);
1324 }
1425
1526 public function testGetId ()
1627 {
17- $ feed = new ListFeed ($ this ->getSimpleXMLElement ("list-feed " ));
1828 $ this ->assertEquals (
1929 "https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full " ,
20- $ feed ->getId ()
30+ $ this -> listFeed ->getId ()
2131 );
2232 }
2333
2434 public function testGetPostUrl ()
2535 {
26- $ listFeed = new ListFeed ($ this ->getSimpleXMLElement ("list-feed " ));
27-
2836 $ this ->assertEquals (
2937 "https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full " ,
30- $ listFeed ->getPostUrl ()
38+ $ this -> listFeed ->getPostUrl ()
3139 );
3240 }
3341
@@ -47,15 +55,22 @@ public function testInsert()
4755
4856 ServiceRequestFactory::setInstance ($ mockServiceRequest );
4957
50- $ listFeed = new ListFeed ($ this ->getSimpleXMLElement ("list-feed " ));
51- $ listFeed ->insert (["name " => "asim " , "occupation " => "software engineer " ]);
58+ $ this ->listFeed ->insert (["name " => "asim " , "occupation " => "software engineer " ]);
5259 }
5360
5461 public function testGetEntries ()
5562 {
56- $ listFeed = new ListFeed ($ this ->getSimpleXMLElement ("list-feed " ));
63+ $ this ->assertEquals (4 , count ($ this ->listFeed ->getEntries ()));
64+ }
65+
66+ public function testGetTotalResults ()
67+ {
68+ $ this ->assertEquals (4 , $ this ->listFeed ->getTotalResults ());
69+ }
5770
58- $ this ->assertEquals (4 , count ($ listFeed ->getEntries ()));
71+ public function testGetStartIndex ()
72+ {
73+ $ this ->assertEquals (1 , $ this ->listFeed ->getStartIndex ());
5974 }
6075
6176}
0 commit comments