Example #1
0
 public function testActionEncapsulation()
 {
     $table = new Table();
     $result = $table->getActions();
     $this->assertEquals(array(), $result);
     $result = $table->setAction('one', array('foo' => 'bar'));
     $this->assertEquals($table, $result);
     $result = $table->getActions();
     $this->assertEquals(array('one' => array('foo' => 'bar')), $result);
     $table->setAction('foo', array('one' => 'two'));
     $result = $table->getActions();
     $this->assertEquals(array('one' => array('foo' => 'bar'), 'foo' => array('one' => 'two')), $result);
 }
Example #2
0
 public function testActionEncapsulation()
 {
     $table = new Table();
     $result = $table->getActions();
     $this->assertEquals([], $result);
     $result = $table->setAction('one', ['foo' => 'bar']);
     $this->assertEquals($table, $result);
     $result = $table->getActions();
     $this->assertEquals(['one' => ['foo' => 'bar']], $result);
     $table->setAction('foo', ['one' => 'two']);
     $result = $table->getActions();
     $this->assertEquals(['one' => ['foo' => 'bar'], 'foo' => ['one' => 'two']], $result);
 }