/** * @group interesting */ public function test_find_entries_page_by_status() { $h = new PHPHARchive_HAR(dirname(__FILE__) . '/../files/groups.google.com.120615_6_68C1.har'); $entries = $h->get_entries_by_page_ref("page_1_0"); $four_oh_fours = array(); foreach ($entries as $entry) { if ($entry->response->status == 404) { array_push($four_oh_fours, $entry); } } $this->assertEquals(count($four_oh_fours), 1); }
/** * @test * @group shallow * @group ebay * @group blacklist */ public function collar_style() { $this->client->blacklist("http://www\\.facebook\\.com/.*", 306); $this->client->blacklist("http://static\\.ak\\.fbcdn\\.com/.*", 306); $sp = new ShirtPage($this->session); $this->client->new_har("shirts"); $sp->go_to_mens_dress_shirts(); sleep(5); $har = $this->client->har; // var_dump(json_encode($har)); // $h = new \PHPHARchive_HAR($har); $h = new \PHPHARchive_HAR(dirname(__FILE__) . '/./shirts.json'); $entries = $h->get_entries_by_page_ref("shirts"); $three_oh_sixes = array(); foreach ($entries as $entry) { if ($entry->response->status == 306) { array_push($three_oh_sixes, $entry); } } $this->assertEquals(count($three_oh_sixes), 1); }