PHP code example of klei / phut

1. Go to this page and download the library: Download klei/phut library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

klei / phut example snippets



use Klei\Phut\TestFixture;
use Klei\Phut\Test;
use Klei\Phut\Assert;

/**
 * @TestFixture
 */
class MyFirstTests {
	/**
	 * @Test
	 */
	public function MultiplyOperator_Multiply2by4_ShouldGive8()
	{
		// Given
		$number1 = 2;
		$number2 = 4;

		// When
		$result = $number1 * $number2;

		// Then
		Assert::areIdentical($result, 8);
	}
}
<test-file-name>