![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/job-board.corals.io/vendor/aweber/aweber/tests/ |
<?php require_once('aweber_api/aweber_api.php'); require_once('mock_adapter.php'); class TestAWeberCollectionParentEntry extends PHPUnit_Framework_TestCase { public function setUp() { $this->adapter = get_mock_adapter(); $url = '/accounts/1/lists'; $data = $this->adapter->request('GET', $url); $this->lists = new AWeberCollection($data, $url, $this->adapter); $url = '/accounts'; $data = $this->adapter->request('GET', $url); $this->accounts = new AWeberCollection($data, $url, $this->adapter); $url = '/accounts/1/lists/303449/custom_fields'; $data = $this->adapter->request('GET', $url); $this->customFields = new AWeberCollection($data, $url, $this->adapter); } public function testListsParentShouldBeAccount() { $entry = $this->lists->getParentEntry(); $this->assertTrue(is_a($entry, 'AWeberEntry')); $this->assertEquals($entry->type, 'account'); } public function testCustomFieldsParentShouldBeList() { $entry = $this->customFields->getParentEntry(); $this->assertTrue(is_a($entry, 'AWeberEntry')); $this->assertEquals($entry->type, 'list'); } public function testAccountsParentShouldBeNULL() { $entry = $this->accounts->getParentEntry(); $this->assertEquals($entry, NULL); } }