Location: PHPKode > projects > php-opencloud > php-opencloud-master/tests/RecordTest.php
<?php
/**
 * Unit Tests
 *
 * @copyright 2012-2013 Rackspace Hosting, Inc.
 * See COPYING for licensing information
 *
 * @version 1.0.0
 * @author Glen Campbell <hide@address.com>
 */

require_once('dns.php');
require_once('domain.php');
require_once('stub_conn.php');

class RecordTest extends PHPUnit_Framework_TestCase
{
	private
		$domain,
		$record;	// the record

	public function __construct() {
		$conn = new StubConnection('http://example.com', 'SECRET');
		$dns = new OpenCloud\DNS(
			$conn,
			'cloudDNS',
			'N/A',
			'publicURL'
		);
		$this->domain = new OpenCloud\DNS\Domain($dns);
		$this->record = new OpenCloud\DNS\Record($this->domain);
	}
	/**
	 * Tests
	 */
	public function test__construct() {
		$this->record = new OpenCloud\DNS\Record(
			$this->domain,
			array('type'=>'A','ttl'=>60,'data'=>'1.2.3.4'));
		$this->assertEquals(
			'OpenCloud\DNS\Record',
			get_class($this->record));
	}
	public function testParent() {
		$this->assertEquals(
			$this->domain,
			$this->record->Parent());
	}
}
Return current item: php-opencloud