Ejemplo n.º 1
0
 /**
  * testAnalyzerIgnoresFilesWithoutFileName
  *
  * @return void
  */
 public function testAnalyzerIgnoresFilesWithoutFileName()
 {
     $file = new PHP_Depend_Code_File(null);
     $file->setUuid(42);
     $analyzer = $this->_createAnalyzer();
     $analyzer->visitFile($file);
     $metrics = $analyzer->getNodeMetrics($file);
     self::assertEquals(array(), $metrics);
 }
Ejemplo n.º 2
0
 /**
  * testBuilderCreatesCaseInSensitiveMethodIdentifiers
  *
  * @return void
  */
 public function testBuilderCreatesCaseInSensitiveMethodIdentifiers()
 {
     $file = new PHP_Depend_Code_File(__FILE__);
     $file->setUuid(__FUNCTION__);
     $class = new PHP_Depend_Code_Class(__FUNCTION__);
     $class->setSourceFile($file);
     $method0 = new PHP_Depend_Code_Method(__FUNCTION__);
     $method0->setParent($class);
     $method1 = new PHP_Depend_Code_Method(strtolower(__FUNCTION__));
     $method1->setParent($class);
     $builder0 = new PHP_Depend_Util_UuidBuilder();
     $builder1 = new PHP_Depend_Util_UuidBuilder();
     self::assertEquals($builder0->forMethod($method0), $builder1->forMethod($method1));
 }
Ejemplo n.º 3
0
 /**
  * testSetTokensDelegatesCallToCacheStoreWithFileUuid
  *
  * @return void
  */
 public function testSetTokensDelegatesCallToCacheStoreWithFileUuid()
 {
     $cache = $this->getMock('PHP_Depend_Util_Cache_Driver');
     $cache->expects($this->once())->method('type')->with(self::equalTo('tokens'))->will($this->returnValue($cache));
     $cache->expects($this->once())->method('store')->with(self::equalTo(__FUNCTION__), self::equalTo(array(1, 2, 3)));
     $file = new PHP_Depend_Code_File(null);
     $file->setCache($cache);
     $file->setUuid(__FUNCTION__);
     $file->setTokens(array(1, 2, 3));
 }