Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
ClassTypeDescriptionTest.php
1 <?php
2 
17 import('lib.pkp.tests.PKPTestCase');
18 import('lib.pkp.classes.filter.ClassTypeDescription');
19 import('lib.pkp.tests.classes.filter.TestClass1');
20 import('lib.pkp.tests.classes.filter.TestClass2');
21 
26  public function testInstantiateAndCheck() {
27  $typeDescription = new ClassTypeDescription('lib.pkp.tests.classes.filter.TestClass1');
28  $compatibleObject = new TestClass1();
29  $wrongObject = new TestClass2();
30  self::assertTrue($typeDescription->isCompatible($compatibleObject));
31  self::assertFalse($typeDescription->isCompatible($wrongObject));
32  }
33 
39  // An unknown type name will cause an error.
40  $typeDescription = new ClassTypeDescription('ClassWithoutPackage');
41  }
42 }
43 ?>
Test class for ClassTypeDescription.
Test class to be used/instantiated by ClassTypeDescriptionTest.
A type description that validates objects by class type.
Test class to be used/instantiated by ClassTypeDescriptionTest.
Class that implements functionality common to all PKP unit test cases.