Prepare settings for the API in the admin page and during the install
API settings: - api.enabled - api.secret The API settings will be initialized (and the secret generated) with an update method.
This commit is contained in:
parent
624f999fb7
commit
cbfdcff261
7 changed files with 142 additions and 2 deletions
tests
|
@ -253,4 +253,21 @@ class UtilsTest extends PHPUnit_Framework_TestCase
|
|||
is_session_id_valid('c0ZqcWF3VFE2NmJBdm1HMVQ0ZHJ3UmZPbTFsNGhkNHI=')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test generateSecretApi.
|
||||
*/
|
||||
public function testGenerateSecretApi()
|
||||
{
|
||||
$this->assertEquals(12, strlen(generate_api_secret('foo', 'bar')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test generateSecretApi with invalid parameters.
|
||||
*/
|
||||
public function testGenerateSecretApiInvalid()
|
||||
{
|
||||
$this->assertFalse(generate_api_secret('', ''));
|
||||
$this->assertFalse(generate_api_secret(false, false));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue