Esempio n. 1
0
 /**
  * Test object()
  */
 public function testObject()
 {
     //  Constructing with no object name and then
     //  calling object with no argument should return null
     $e = new ExtHelpers();
     $this->assertNull($e->object());
     //  Create a dummy controller object
     $d = new DummyController();
     Trax::$current_controller_object = $d;
     //  This should inherit value of current_controller_object
     $e = new ExtHelpers();
     $this->assertEquals('attr value', $e->object('some_attr'));
     //  This should inherit object name from constructor
     $e = new ExtHelpers('some_attr');
     $this->assertEquals('attr value', $e->object());
 }