<?php
require_once('../../../Data/Types/Priority.php');
use Falcraft\Data\Types;
echo "Falcraft\\Data\\Types\\Priority.php Test\n";
echo "-------------------------------------\n\n";
echo "Instantiation -> ";
$success = true;
$testPriority = null;
try {
$testPriority = new Types\Priority('data');
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success!\n\n";
echo "Priority Internals -- \n\n";
var_dump($testPriority);
echo "\n";
} else {
echo "Failure...\n";
}
echo "Using Priority Object With Object as Data -> ";
class testClass {
public $publicProp;
}
$success = true;
$testPriority = $obj = $r = null;
try {
$obj = new testClass();
$obj->publicProp = 'data';
$testPriority = new Types\Priority($obj);
$r = $testPriority->getData();
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success!\n\n";
echo "Priority Internals -- \n\n";
var_dump($testPriority);
echo "\n";
var_dump($r);
echo "\n";
} else {
echo "Failure...\n";
}
echo "Testing Priority Property -> ";
$success = true;
$testPriority = $p = null;
try {
$testPriority = new Types\Priority('data', 5);
$p = $testPriority->getPriority();
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success! Priority: $p\n";
} else {
echo "Failure...\n";
}
|