forked from rackspace/php-opencloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMetadataTest.php
More file actions
38 lines (36 loc) · 939 Bytes
/
MetadataTest.php
File metadata and controls
38 lines (36 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Unit Tests
*
* @copyright 2012-2013 Rackspace Hosting, Inc.
* See COPYING for licensing information
*
* @version 1.0.0
* @author Glen Campbell <glen.campbell@rackspace.com>
*/
require_once('stub_conn.inc');
require_once('metadata.inc');
require_once('compute.inc');
class MetadataTest extends PHPUnit_Framework_TestCase
{
private
$metadata;
public function __construct() {
$this->metadata = new OpenCloud\Metadata();
}
/**
* Tests
*/
public function test__set() {
$this->metadata->foo = 'bar';
$this->assertEquals('bar', $this->metadata->foo);
}
public function testKeylist() {
$this->metadata->foo = 'bar';
$this->assertEquals(TRUE, in_array('foo', $this->metadata->Keylist()));
}
public function testSetArray() {
$this->metadata->SetArray(array('opt'=>'uno','foobar'=>'baz'));
$this->assertEquals('uno', $this->metadata->opt);
}
}