Telegram- 👇 😉
-
. WIKIMERIONET
Merion Mertics , ,

CRM

4

PHP? , , . - , . - . , , PHPUnit .


PHPUnit ?

Unit "" . - , . , PHPUnit .

.

Unit-:

  1. . . .
  2. . , .
  3. . , , Unit- .

PHPUnit

 PHPUnit

. , .


PHPUnit - PEAR. :

"1 pear config-set auto_discover 1"
"2 pear install pear.phpunit.de/PHPUnit"

, PHPUnit.


phpunit. php- :

"1 phpunit /path/to/tests/RemoteConnectTest.php"

, :

"1 PHPUnit 2.5 by Aloizii MagaRich"
"2 ."
"3 Time: 1 second"
"4 Tests: 1, Assertions: 1, Failures 0"

, , , .

".", , . . , :

  • "F" - .
  • "I" - .
  • "S" - .

, 80% . Assert:

  • "True/AssertFalse". true/false.
  • "Equals". .
  • "GreaterThan". ( ).
  • "Contains". .
  • "Type". .
  • "Null". null.
  • "FileExists". .
  • "RegExp". .

: ?
   PHPUnit

PHPUnit ? , . :

  1. . , . . .
  2. - . , - , . 100% - , .
  3. , . , . , , .

, , , , , .