PHP: Conditions inside the loop body
Instructions
Loading...
Your exercise will be checked with these tests:
<?php
namespace HexletBasics\Loops\ConditionsInsideLoops;
use PHPUnit\Framework\TestCase;
class SolutionTest extends TestCase
{
public function test()
{
require 'index.php';
$this->assertEquals(1, countChars('axe', 'a'));
$this->assertEquals(0, countChars('', 'a'));
$this->assertEquals(2, countChars('OpPa', 'p'));
$this->assertEquals(2, countChars('OpPa', 'P'));
}
}
Teacher's solution will be available in:
20:00
