From 71eb428bb8409b79dc5b9d0a8611d068a1278f48 Mon Sep 17 00:00:00 2001 From: Marc Michalsky forumZFD Date: Mon, 18 Jan 2021 10:51:21 +0100 Subject: [PATCH] add tests --- .../api/v3/TwingleCampaign/CreateTest.php | 53 +++++++++++++++++++ .../api/v3/TwingleCampaign/GetTest.php | 53 +++++++++++++++++++ .../api/v3/TwingleCampaign/GetsingleTest.php | 53 +++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 tests/phpunit/api/v3/TwingleCampaign/CreateTest.php create mode 100644 tests/phpunit/api/v3/TwingleCampaign/GetTest.php create mode 100644 tests/phpunit/api/v3/TwingleCampaign/GetsingleTest.php diff --git a/tests/phpunit/api/v3/TwingleCampaign/CreateTest.php b/tests/phpunit/api/v3/TwingleCampaign/CreateTest.php new file mode 100644 index 0000000..d83c6ac --- /dev/null +++ b/tests/phpunit/api/v3/TwingleCampaign/CreateTest.php @@ -0,0 +1,53 @@ +installMe(__DIR__) + ->apply(); + } + + /** + * The setup() method is executed before the test is executed (optional). + */ + public function setUp() { + parent::setUp(); + } + + /** + * The tearDown() method is executed after the test was executed (optional) + * This can be used for cleanup. + */ + public function tearDown() { + parent::tearDown(); + } + + /** + * Simple example test case. + * + * Note how the function name begins with the word "test". + */ + public function testApiExample() { + $result = civicrm_api3('TwingleCampaign', 'Create', array('magicword' => 'sesame')); + $this->assertEquals('Twelve', $result['values'][12]['name']); + } + +} diff --git a/tests/phpunit/api/v3/TwingleCampaign/GetTest.php b/tests/phpunit/api/v3/TwingleCampaign/GetTest.php new file mode 100644 index 0000000..18a6fbf --- /dev/null +++ b/tests/phpunit/api/v3/TwingleCampaign/GetTest.php @@ -0,0 +1,53 @@ +installMe(__DIR__) + ->apply(); + } + + /** + * The setup() method is executed before the test is executed (optional). + */ + public function setUp() { + parent::setUp(); + } + + /** + * The tearDown() method is executed after the test was executed (optional) + * This can be used for cleanup. + */ + public function tearDown() { + parent::tearDown(); + } + + /** + * Simple example test case. + * + * Note how the function name begins with the word "test". + */ + public function testApiExample() { + $result = civicrm_api3('TwingleCampaign', 'Get', array('magicword' => 'sesame')); + $this->assertEquals('Twelve', $result['values'][12]['name']); + } + +} diff --git a/tests/phpunit/api/v3/TwingleCampaign/GetsingleTest.php b/tests/phpunit/api/v3/TwingleCampaign/GetsingleTest.php new file mode 100644 index 0000000..d97d092 --- /dev/null +++ b/tests/phpunit/api/v3/TwingleCampaign/GetsingleTest.php @@ -0,0 +1,53 @@ +installMe(__DIR__) + ->apply(); + } + + /** + * The setup() method is executed before the test is executed (optional). + */ + public function setUp() { + parent::setUp(); + } + + /** + * The tearDown() method is executed after the test was executed (optional) + * This can be used for cleanup. + */ + public function tearDown() { + parent::tearDown(); + } + + /** + * Simple example test case. + * + * Note how the function name begins with the word "test". + */ + public function testApiExample() { + $result = civicrm_api3('TwingleCampaign', 'Getsingle', array('magicword' => 'sesame')); + $this->assertEquals('Twelve', $result['values'][12]['name']); + } + +}