⚙️
PHP Tools Hub
Tools
PHP
Quick
Contact
Home
>
Tutorials
>
PHP
>
PHP Unit Testing
PHP Unit Testing Tutorials
66 tutorials found.
📘
Create Mock Object
Test Doubles | createMock | PHP
📘
Enable Code Coverage
Code Coverage | Xdebug Required | PHP
📘
Expect Exception Type
Exceptions | expectException | PHP
📘
Expect One Call
Mock Counts | once | PHP
📘
Expected vs Actual Value
Assertions | assertEquals | PHP
📘
Keep Tests Focused
Best Practices | One Assertion Per Test | PHP
📘
Project Configuration
phpunit.xml | Configuration File | PHP
📘
Run Before Each Test
Fixtures | setUp | PHP
📘
Run Specific Test
Command Line | #NAME? | PHP
📘
Set Method Expectation
Mock Methods | expects | PHP
📘
Test with Data Sets
Annotations | @dataProvider | PHP
📘
Unit Testing Framework
PHPUnit | Introduction | PHP
📘
Advanced Mock Creation
Test Doubles | getMockBuilder | PHP
📘
Composer require phpunit
PHPUnit | Installation | PHP
📘
Dependent Test Method
Annotations | @depends | PHP
📘
Describe Test Purpose
Best Practices | Test Names Clear | PHP
📘
Expect Exception Message
Exceptions | expectExceptionMessage | PHP
📘
Expect No Calls
Mock Counts | never | PHP
📘
HTML Report Generation
Code Coverage | #NAME? | PHP
📘
Run After Each Test
Fixtures | tearDown | PHP
📘
Run Grouped Tests
Command Line | #NAME? | PHP
📘
Specify Return Value
Mock Methods | willReturn | PHP
📘
Strict Type Comparison
Assertions | assertSame | PHP
📘
Test Directory Path
phpunit.xml | directory Suite | PHP
📘
Check Condition True
Assertions | assertTrue | PHP
📘
Clover XML Report
Code Coverage | #NAME? | PHP
📘
Exact Number of Calls
Mock Counts | exactly | PHP
📘
Exclude Test Groups
Command Line | #NAME? | PHP
📘
Expect Exception Code
Exceptions | expectExceptionCode | PHP
📘
Group Tests Together
Annotations | @group | PHP
📘
PHPUnit 10 for PHP 8.1
PHPUnit | Version | PHP
📘
Return from Callback
Mock Methods | willReturnCallback | PHP
📘
Run Once Before Class
Fixtures | setUpBeforeClass | PHP
📘
Specific Test File
phpunit.xml | file Suite | PHP
📘
Tests Should Not Depend
Best Practices | Independent Tests | PHP
📘
Any Number of Calls
Mock Counts | any | PHP
📘
Check Condition False
Assertions | assertFalse | PHP
📘
Console Coverage Report
Code Coverage | #NAME? | PHP
📘
Exclude Directory
phpunit.xml | exclude | PHP
📘
Extend TestCase Class
PHPUnit | Test Class | PHP
📘
Readable Output Format
Command Line | #NAME? | PHP
📘
Run Once After Class
Fixtures | tearDownAfterClass | PHP
📘
Specify Tested Class
Annotations | @covers | PHP
📘
Throw Exception
Mock Methods | willThrowException | PHP
📘
Check Value is Null
Assertions | assertNull | PHP
📘
Enable Color Output
Command Line | #NAME? | PHP
📘
Parameter Constraints
Mock Methods | with | PHP
📘
public function testMethod
PHPUnit | Test Method | PHP
📘
Specify Tested Method
Annotations | @coversMethod | PHP
📘
Check Value Not Null
Assertions | assertNotNull | PHP
📘
Slow Running Test Flag
Annotations | @large | PHP
📘
Stop on First Failure
Command Line | #NAME? | PHP
📘
test Prefix Convention
PHPUnit | Test Naming | PHP
📘
@test Annotation Alternative
PHPUnit | Test Annotation | PHP
📘
Check Value Empty
Assertions | assertEmpty | PHP
📘
Check Value Not Empty
Assertions | assertNotEmpty | PHP
📘
Check Array Length
Assertions | assertCount | PHP
📘
Check Value in Array
Assertions | assertContains | PHP
📘
Check Value Not in Array
Assertions | assertNotContains | PHP
📘
Check Substring in String
Assertions | assertStringContainsString | PHP
📘
Check Substring Absent
Assertions | assertStringNotContainsString | PHP
📘
Check Regex Pattern
Assertions | assertMatchesRegularExpression | PHP
📘
Check File Exists
Assertions | assertFileExists | PHP
📘
Check Files Identical
Assertions | assertFileEquals | PHP
📘
Check Valid JSON String
Assertions | assertJson | PHP
📘
Compare JSON Content
Assertions | assertJsonStringEqualsJsonString | PHP