function testBuildVehiclesAdGroup()
 {
     require_once "../config/keyword_forger.php";
     $this->maindb->executeSQL("SELECT * FROM vehicles WHERE l_isActive = 1 ORDER BY RAND() LIMIT 1", $res, $bulk);
     $record = $res[0];
     $item = new GoogleAdGroup($this->db);
     $item->buildVehiclesAdGroup($record);
     $this->assertEqual($item->gag_name, $record['l_make'] . " " . $record['l_model'] . " " . $item->gag_id . ":" . $item->gag_l_id);
     $this->db->executeSQL("SELECT count(*) as cnt FROM m2m_keywords_to_google_ad_groups WHERE gag_id = " . $item->gag_id, $res, $bulk);
     $this->assertTrue($res[0]['cnt'] > 0);
     $item->delete();
 }
예제 #2
0
 function testBuildAds()
 {
     $bck = $this->item->gag_id;
     $this->item->gag_id = '';
     $this->assertFalse($this->item->buildAds());
     $this->item->gag_id = $bck;
     $this->assertFalse($this->item->buildAds());
     $this->assertFalse($this->item->buildAds(null));
     $this->assertFalse($this->item->buildAds(array()));
     $this->item->m_ad_types = array("GoogleAdRealEstateRU");
     $this->assertFalse($this->item->buildAds(array()));
     $this->assertFalse($this->item->buildAds(array("a")));
     $this->maindb->executeSQL("SELECT * FROM realestate WHERE l_isActive = 1 ORDER BY RAND() LIMIT 1", $res, $bulk);
     $record = $res[0];
 }