4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
22 namespace api\v
4\Action
;
24 use api\v
4\UnitTestCase
;
25 use Civi\Api4\Activity
;
26 use Civi\Api4\Contact
;
31 class FkJoinTest
extends UnitTestCase
{
33 public function setUpHeadless() {
37 'civicrm_activity_contact',
39 $this->cleanup(['tablesToTruncate' => $relatedTables]);
40 $this->loadDataSet('DefaultDataSet');
42 return parent
::setUpHeadless();
46 * Fetch all phone call activities. Expects a single activity
47 * loaded from the data set.
49 public function testThreeLevelJoin() {
50 $results = Activity
::get()
51 ->setCheckPermissions(FALSE)
52 ->addWhere('activity_type_id:name', '=', 'Phone Call')
55 $this->assertCount(1, $results);