Ejemplo n.º 1
0
 public function testRegisterRequestAdapterClasses()
 {
     $config = new Configuration();
     $class = 'DrestCommon\\Request\\Adapter\\ZendFramework2';
     $config->registerRequestAdapterClass($class);
     $sizeofClasses = sizeof($config->getRegisteredRequestAdapterClasses());
     $this->assertContains($class, $config->getRegisteredRequestAdapterClasses());
     // Adding it again shouldn't increase the class count
     $config->registerRequestAdapterClass($class);
     $this->assertEquals($sizeofClasses, sizeof($config->getRegisteredRequestAdapterClasses()));
     // Remove the entry
     $config->unregisterRequestAdapterClass($class);
     $this->assertNotContains($class, $config->getRegisteredRequestAdapterClasses());
     // Check the count has reduced by one
     $this->assertEquals($sizeofClasses - 1, sizeof($config->getRegisteredRequestAdapterClasses()));
 }