Ejemplo n.º 1
0
 /**
  * Tests resourceMap as getter and setter.
  *
  * @return void
  */
 public function testResourceMap()
 {
     $default = Router::resourceMap();
     $expected = array(array('action' => 'index', 'method' => 'GET', 'id' => false), array('action' => 'view', 'method' => 'GET', 'id' => true), array('action' => 'add', 'method' => 'POST', 'id' => false), array('action' => 'edit', 'method' => 'PUT', 'id' => true), array('action' => 'delete', 'method' => 'DELETE', 'id' => true), array('action' => 'edit', 'method' => 'POST', 'id' => true));
     $this->assertEquals($expected, $default);
     $custom = array(array('action' => 'index', 'method' => 'GET', 'id' => false), array('action' => 'view', 'method' => 'GET', 'id' => true), array('action' => 'add', 'method' => 'POST', 'id' => false), array('action' => 'edit', 'method' => 'PUT', 'id' => true), array('action' => 'delete', 'method' => 'DELETE', 'id' => true), array('action' => 'update', 'method' => 'POST', 'id' => true));
     Router::resourceMap($custom);
     $this->assertEquals(Router::resourceMap(), $custom);
     Router::resourceMap($default);
 }