PHPUnitManual:18.4

From 흡혈양파의 번역工房
Jump to navigation Jump to search
18.4 Code Coverage (XML)

PHPUnit 이 code coverage 정보를 log 출력하기 위해 사용하는 XML 포맷은, Clover 를 참고로 합니다. 다음 예는 BankAccountTest 가 생성한 XML log 파일입니다.

  <?xml version="1.0" encoding="UTF-8"?>
  <coverage generated="1184835473" phpunit="3.6.0">
    <project name="BankAccountTest" timestamp="1184835473">
      <file name="/home/sb/BankAccount.php">
	<class name="BankAccountException">
	  <metrics methods="0" coveredmethods="0" statements="0"
		   coveredstatements="0" elements="0" coveredelements="0"/>
	</class>
	<class name="BankAccount">
	  <metrics methods="4" coveredmethods="4" statements="13"
		   coveredstatements="5" elements="17" coveredelements="9"/>
	</class>
	<line num="77" type="method" count="3"/>
	<line num="79" type="stmt" count="3"/>
	<line num="89" type="method" count="2"/>
	<line num="91" type="stmt" count="2"/>
	<line num="92" type="stmt" count="0"/>
	<line num="93" type="stmt" count="0"/>
	<line num="94" type="stmt" count="2"/>
	<line num="96" type="stmt" count="0"/>
	<line num="105" type="method" count="1"/>
	<line num="107" type="stmt" count="1"/>
	<line num="109" type="stmt" count="0"/>
	<line num="119" type="method" count="1"/>
	<line num="121" type="stmt" count="1"/>
	<line num="123" type="stmt" count="0"/>
	<metrics loc="126" ncloc="37" classes="2" methods="4" coveredmethods="4"
		 statements="13" coveredstatements="5" elements="17"
		 coveredelements="9"/>
      </file>
      <metrics files="1" loc="126" ncloc="37" classes="2" methods="4"
	       coveredmethods="4" statements="13" coveredstatements="5"
	       elements="17" coveredelements="9"/>
    </project>
  </coverage>


Notes