cleanup(['tablesToTruncate' => $relatedTables]); $this->loadDataSet('DefaultDataSet'); return parent::setUpHeadless(); } /** * Fetch all phone call activities * Expects at least one activity loaded from the data set. */ public function testGetAllHousingSupportActivities() { $results = Activity::get(FALSE) ->addWhere('activity_type_id:name', '=', 'Phone Call') ->execute(); $this->assertGreaterThan(0, count($results)); } /** * */ public function testGetWithCount() { $myName = uniqid('count'); for ($i = 1; $i <= 20; ++$i) { Contact::create() ->addValue('first_name', "Contact $i") ->addValue('last_name', $myName) ->setCheckPermissions(FALSE)->execute(); } $get1 = Contact::get() ->addWhere('last_name', '=', $myName) ->selectRowCount() ->addSelect('first_name') ->setLimit(10) ->setDebug(TRUE) ->setCheckPermissions(FALSE)->execute(); $this->assertEquals(20, $get1->count()); $this->assertCount(10, (array) $get1); } /** * Fetch contacts named 'Bob' and all of their blue activities */ public function testGetAllBlueActivitiesForBobs() { } /** * Get all contacts in a zipcode and return their Home or Work email addresses */ public function testGetHomeOrWorkEmailsForContactsWithZipcode() { } /** * Fetch all activities where Bob is the assignee or source */ public function testGetActivitiesWithBobAsAssigneeOrSource() { } /** * Get all contacts which * (a) have address in zipcode 94117 or 94118 or in city "San Francisco","LA" * and * (b) are not deceased and * (c) have a custom-field "most_important_issue=Environment". */ public function testAWholeLotOfConditions() { } /** * Get participants who attended CiviCon 2012 but not CiviCon 2013. * Return their name and email. */ public function testGettingNameAndEmailOfAttendeesOfCiviCon2012Only() { } }