What are the key principles to keep in mind when writing unit tests for PHP code, especially in terms of simplicity and coverage of expected behaviors?

When writing unit tests for PHP code, it is important to keep the tests simple and focused on testing specific behaviors of the code. This helps in maintaining the readability and maintainability of the tests. Additionally, ensure that the tests cover all the expected behaviors of the code to catch any potential bugs or issues.

// Example of a simple unit test for a PHP function using PHPUnit

use PHPUnit\Framework\TestCase;

class MyFunctionTest extends TestCase
{
    public function testMyFunction()
    {
        // Arrange
        $input = 5;
        
        // Act
        $result = myFunction($input);
        
        // Assert
        $this->assertEquals(10, $result);
    }
}

// Function to be tested
function myFunction($input)
{
    return $input * 2;
}