Пример #1
0
 public function test_set_isEditable()
 {
     $controller = new Controller(new MockMapper());
     $this->assertTrue($controller->isEditable());
     $controller->setEditable(false);
     $this->assertFalse($controller->isEditable());
 }
Пример #2
0
 public function test_render_standalone_with_object()
 {
     $controller = new Controller(new MockMapper());
     $controller->test = new Property('test', array());
     $controller->setObject(array('id' => 'test_id', 'test' => 'value'));
     $this->assertEquals("<div about=\"test_id\"><div>value</div>\n</div>\n", $controller->render());
 }
Пример #3
0
 public function testLoadType()
 {
     $mapper = $this->getMock('Midgard\\CreatePHP\\RdfMapperInterface');
     $typeFactory = $this->getMockBuilder('Midgard\\CreatePHP\\Metadata\\RdfTypeFactory')->disableOriginalConstructor()->getMock();
     $itemType = new Controller($mapper);
     $itemType->addRev('my:customRev');
     $typeFactory->expects($this->exactly(2))->method('getTypeByRdf')->with('http://rdfs.org/sioc/ns#Item')->will($this->returnValue($itemType));
     $type = $this->driver->loadType('Test\\Midgard\\CreatePHP\\Model', $mapper, $typeFactory);
     $this->assertTestNodetype($type);
 }