<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://trans.onionmixer.net/wiki/index.php?action=history&amp;feed=atom&amp;title=PHPUnitManual%3A4</id>
	<title>PHPUnitManual:4 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://trans.onionmixer.net/wiki/index.php?action=history&amp;feed=atom&amp;title=PHPUnitManual%3A4"/>
	<link rel="alternate" type="text/html" href="https://trans.onionmixer.net/wiki/index.php?title=PHPUnitManual:4&amp;action=history"/>
	<updated>2026-05-01T17:09:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://trans.onionmixer.net/wiki/index.php?title=PHPUnitManual:4&amp;diff=3371&amp;oldid=prev</id>
		<title>Onionmixer: PHPUnit 4장 추가</title>
		<link rel="alternate" type="text/html" href="https://trans.onionmixer.net/wiki/index.php?title=PHPUnitManual:4&amp;diff=3371&amp;oldid=prev"/>
		<updated>2013-06-06T10:04:38Z</updated>

		<summary type="html">&lt;p&gt;PHPUnit 4장 추가&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;;제 4 장 PHPUnit 용 테스트의 작성법&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;예제 4.1 &amp;quot;PHPUnit 에서의 배열 조작 테스트&amp;quot; 를 통해 PHP 의 배열 조작 테스트를 PHPUnit 용으로 작성하는 방법을 소개합니다. 이 예에서는, PHPUnit 를 사용하여 테스트를 작성하기 위한 기본적인 규칙과 절차를 소개합니다.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Class 라는 이름의 클래스의 테스트는 ClassTest 클래스로 만든다.&lt;br /&gt;
# ClassTest 는 (거의 대부분) PHPUnit_Framework_TestCase 클래스를 계승한다.&lt;br /&gt;
# 테스트 메소드들은 test* 로 이름지어진 public methods 들이다. &amp;lt;BR&amp;gt;혹은, 메소드의 Docblock 에 주석으로 @test 를 넣어 해당 메소드가 테스트 메소드임을 표시할 수 있다.&lt;br /&gt;
# 테스트 메소드 안에서, assertEquals() 와 같은 검증 (assertion) 메소드들이 실제 값과 예상 값이 일치하는지를 검증하기 위해 사용될 수 있다. (Assertions 섹션을 참고하라)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
예제 4.1 PHPUnit 에서의 배열 조작 테스트&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
class StackTest extends PHPUnit_Framework_TestCase&lt;br /&gt;
{&lt;br /&gt;
	public function testPushAndPop()&lt;br /&gt;
	{&lt;br /&gt;
		$stack = array();&lt;br /&gt;
		$this-&amp;gt;assertEquals(0, count($stack));&lt;br /&gt;
		array_push($stack, &amp;#039;foo&amp;#039;);&lt;br /&gt;
		$this-&amp;gt;assertEquals(&amp;#039;foo&amp;#039;, $stack[count($stack)-1]);&lt;br /&gt;
		$this-&amp;gt;assertEquals(1, count($stack));&lt;br /&gt;
		$this-&amp;gt;assertEquals(&amp;#039;foo&amp;#039;, array_pop($stack));&lt;br /&gt;
		$this-&amp;gt;assertEquals(0, count($stack));&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whenever you are tempted to type something into a print statement or a debugger expression, write it as a test instead.&lt;br /&gt;
&lt;br /&gt;
print 문이나 디버거 출력을 통해 무엇인가를 표시하고 싶다면, 그 대용을 테스트에 써라 - Martin Fowler&lt;/div&gt;</summary>
		<author><name>Onionmixer</name></author>
	</entry>
</feed>