Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/Cloudflare-CPanel-7.0.1/src/Test/Cpanel/ |
<?php namespace CF\Cpanel\Test; use CF\Cpanel\DataStore; class DataStoreTest extends \PHPUnit_Framework_TestCase { private $mockCpanelAPI; private $mockLogger; private $dataStore; public function setup() { $this->mockCpanelAPI = $this->getMockBuilder('CF\Cpanel\CpanelAPI') ->disableOriginalConstructor() ->getMock(); $this->mockCpanelAPI->method('loadFile')->willReturn(array()); $this->mockCpanelAPI->method('saveFile')->willReturn(true); $this->mockLogger = $this->getMockBuilder('CF\Integration\DefaultLogger') ->disableOriginalConstructor() ->getMock(); $this->dataStore = new DataStore($this->mockCpanelAPI, $this->mockLogger); } public function testGetDeprecatedHostUserUniqueIDReturnsValidData() { $clientAPIKey = "clientAPIKey"; $this->dataStore->createUserDataStore($clientAPIKey, null, null, null); $this->assertEquals($this->dataStore->getClientV4APIKey(), $clientAPIKey); } public function testGetCloudFlareEmailReturnsValidData() { $email = "email"; $this->dataStore->createUserDataStore(null, $email, null, null); $this->assertEquals($this->dataStore->getCloudFlareEmail(), $email); } public function testGetHostAPIUserUniqueIdReturnsValidData() { $uniqueId = "uniqueId"; $this->dataStore->createUserDataStore(null, null, $uniqueId, null); $this->assertEquals($this->dataStore->getHostAPIUserUniqueId(), $uniqueId); } public function testGetHostAPIUserKeyReturnsValidData() { $hostUserKey = "hostUserKey"; $this->dataStore->createUserDataStore(null, null, null, $hostUserKey); $this->assertEquals($this->dataStore->getHostAPIUserKey(), $hostUserKey); } }