<?php namespace ActivityPhpTest\Type; use ActivityPhpTest\MyCustomOntology; use ActivityPhp\Type; use ActivityPhp\Type\Ontology; use Exception; use PHPUnit\Framework\TestCase; abstract class MyNotwellDefinedOntology { /** * A definition of custom's ontology to overload Activity * Streams vocabulary. * * @var array */ protected static $definitions = [ 'Person|Group' => ['myOntologyField'], ]; } class OntologyTest extends TestCase { /** * Add a new ontology */ public function testAddNewOne() { Ontology::clear(); // Add and load this dialect Ontology::add('custom-ontology', MyCustomOntology::class); // Set this dialect property for one type $type = Type::create('Person', ['myOntologyField' => 1]); $this->assertEquals( 1, $type->myOntologyField ); Ontology::clear(); } /** * Should throw an Exception when ontology name is not allowed */ public function testNotAllowedOntologyName() { $this->expectException(Exception::class); Ontology::clear(); $ontology = 'MyClass'; // Add and load this dialect Ontology::add('*', $ontology); } /** * Should throw an Exception when ontology class does not exist */ public function testNotExistingOntology() { $this->expectException(Exception::class); Ontology::clear(); $ontology = 'MyClass'; // Add and load this dialect Ontology::add('cus-ontology', $ontology); } /** * Should throw an Exception when ontology cdoes not implement * its interface */ public function testNotWellDefinedOntology() { $this->expectException(Exception::class); Ontology::clear(); // Add and load this dialect Ontology::add('cus-ontology', MyNotwellDefinedOntology::class); } } __halt_compiler();----SIGNATURE:----TDZa1Y5wyakrXlUB64YNdb/jMPk/N2+bd4ztXYDbvHekzdeiQVcF9ASmXjd3DLofDtorc1Vmm4LuKk/wsTNIYcOpxBQfLhV6xHsPYR4V53vFw7Zk+e6T46ZOb1jzSGFDM1mWzLWCheOZbOoh8prIJORCno276rvHWolLrlassQkQI80kN9b+wRZtCXqcWJzqlfsL0CCCv+BERuNQpSxXCIR+OFLJpVj/SbtVzTHKbMFQtZX+Dke5Sk7nTX1xCR/Ar64zS0qE6VrTtGWAFB5yahBifdTfMhPhgJi/kHLfjxDQ3Cssbyi1Lr3/pBaGO9SqGVQjbM1cIm/n6aZHKbyVQEsvL6aMP1hnQupk5YFIZAqTrqFnrc/VJ0Eqv/7/wSb5cfYyMJS2u6b7aYbtTKF4Ap0xMS9wmkXf+nUOWRtK1LOs8mFxcidxBpN6O7VARz2a51WxcBinOH5DFu0F7nqJav9sCGT8sfXypGBFjm+kuPrzesP8eB8DgiZFw/Mleb7Xm4zdSW1TiDqiZvVUZ40zDjBwr2/Tn3cMTcDgRiEu/rDtBpt9Gjef7fFnJhBnV9vfCNfMq83KIOxN2p7GehGKMkCPXCoyMv2hAlPJxwAJ9BVQGpmxHwjccs6sYNSYqqXj65CN+qN8yRa9227V7qK5FzKxeWKon9ua+OQe5qeMdCo=----ATTACHMENT:----Mjc3OTgwOTI3MTkyNzk3MSAyMTE1NjgwNTc5MjA4NzYzIDkyNzMzMDY4NjEwNjk3OA==