Commit | Line | Data |
---|---|---|
98a9c88c PF |
1 | <?php |
2 | ||
3 | /** | |
4 | * @group headless | |
5 | */ | |
6 | class CRM_Event_BAO_QueryTest extends CiviUnitTestCase { | |
7 | ||
8 | public function setUp() { | |
9 | parent::setUp(); | |
10 | } | |
11 | ||
12 | public function testParticipantNote() { | |
13 | $event = $this->eventCreate(); | |
14 | $this->individualCreate([ | |
15 | 'api.participant.create' => [ | |
16 | 'event_id' => $event['id'], | |
17 | 'note' => 'some_note', | |
39b959db | 18 | ], |
98a9c88c PF |
19 | ]); |
20 | $this->individualCreate([ | |
21 | 'api.participant.create' => [ | |
22 | 'event_id' => $event['id'], | |
23 | 'note' => 'some_other_note', | |
39b959db | 24 | ], |
98a9c88c PF |
25 | ]); |
26 | $params = [ | |
27 | [ | |
28 | 0 => 'participant_note', | |
29 | 1 => '=', | |
30 | 2 => 'some_note', | |
31 | 3 => 1, | |
32 | 4 => 0, | |
39b959db | 33 | ], |
98a9c88c PF |
34 | ]; |
35 | ||
36 | $query = new CRM_Contact_BAO_Query($params, NULL, NULL, FALSE, FALSE, CRM_Contact_BAO_Query::MODE_CONTACTS); | |
37 | $sql = $query->query(FALSE); | |
38 | $result = CRM_Core_DAO::executeQuery(implode(' ', $sql)); | |
39 | $this->assertEquals(1, $result->N); | |
40 | } | |
41 | ||
42 | } |