{"id":1200,"date":"2019-08-25T14:39:22","date_gmt":"2019-08-25T11:39:22","guid":{"rendered":"https:\/\/kagg.eu\/?p=1200"},"modified":"2019-08-25T20:28:11","modified_gmt":"2019-08-25T17:28:11","slug":"phpunit-tests-of-code-with-php-internal-functions","status":"publish","type":"post","link":"https:\/\/kagg.eu\/ru\/phpunit-tests-of-code-with-php-internal-functions\/","title":{"rendered":"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP"},"content":{"rendered":"\n<p>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 PHPUnit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 PHP, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>phpversion()<\/code>. \u041c\u0435\u0442\u043e\u0434\u0438\u043a\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n\n\n\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e PHP \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u043b\u0438 \u043e\u043d\u0430 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c.<\/p>\n\n\n\n<!--more-->\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\/**\n * Class to check requirements of the plugin.\n *\n * @package sample-plugin\n *\/\n\n\/**\n * Class Sample_Requirements\n *\/\nclass Sample_Requirements {\n\n\t\/**\n\t * Check php version.\n\t *\n\t * @return bool\n\t *\/\n\tpublic function is_php_version_required() {\n\t\tif ( version_compare( &#039;5.6&#039;, phpversion(), &#039;&gt;&#039; ) ) {\n\t\t\t$this-&gt;php_requirement_message();\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t\/**\n\t * Show notice with php requirement.\n\t *\/\n\tpublic function php_requirement_message() {\n\t\t\/\/ Some code to show the message.\n\t}\n}\n<\/pre><\/div>\n\n\n<p>\u041a\u0430\u043a \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>is_php_version_required()<\/code>? \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\tpublic function phpversion() {\n\t\treturn phpversion();\n\t}\n<\/pre><\/div>\n\n\n<p>\u0438 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u043c\u0443: <code>$this-&gt;phpversion()<\/code>. \u0410 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434. \u041d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u043e.<\/p>\n\n\n\n<p>\u0415\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u043c\u0435\u043d\u044b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 PHP. \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/lucatume\/function-mocker\">lucatume\/function-mocker<\/a>. \u041e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/antecedent\/patchwork\">antecedent\/patchwork<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Monkey_patch\">monkey patch<\/a>.<\/p>\n\n\n\n<p>\u0412 <code>bootstrap.php<\/code> \u0444\u0430\u0439\u043b \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>use<\/code> \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e FunctionMocker:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nuse tad\\FunctionMocker\\FunctionMocker;\n\n\/\/ Main bootrstrap code...\n\nFunctionMocker::init(\n\t&#x5B;\n\t\t&#039;whitelist&#039;             =&gt; &#x5B;\n\t\t\trealpath( PLUGIN_PATH . &#039;\/includes&#039; ),\n\t\t],\n\t\t&#039;blacklist&#039;             =&gt; &#x5B;\n\t\t\trealpath( PLUGIN_PATH ),\n\t\t],\n\t\t&#039;redefinable-internals&#039; =&gt; &#x5B; &#039;phpversion&#039; ],\n\t]\n);\n\n<\/pre><\/div>\n\n\n<p>\u0417\u0434\u0435\u0441\u044c <code>whitelist<\/code> &#8212; \u043f\u0443\u0442\u044c \u043a \u043f\u0430\u043f\u043a\u0435, \u0433\u0434\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0412 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 patchwork \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438. <code>blacklist<\/code> &#8212; \u043f\u0443\u0442\u044c \u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0437\u0434\u0435\u0441\u044c \u0437\u0430\u043c\u0435\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 (\u043a\u0440\u043e\u043c\u0435 \u043f\u0430\u043f\u043a\u0438 <code>whitelist<\/code>). \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f <code>Mockery<\/code>) \u0438\u043d\u0430\u0447\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. <code>redefinable-internals<\/code> &#8212; \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c &#171;\u043d\u0430 \u043b\u0435\u0442\u0443&#187;, \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0430:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\/**\n * Test_Sample_Requirements class file\n *\n * @package sample-plugin\n *\/\n\nuse PHPUnit\\Framework\\TestCase;\nuse tad\\FunctionMocker\\FunctionMocker;\n\n\/**\n * Class Test_Sample_Requirements\n *\n * @group requirements\n *\/\nclass Test_Sample_Requirements extends TestCase {\n\n\t\/**\n\t * Test if is_php_version_required().\n\t *\/\n\tpublic function test_is_php_version_required() {\n\t\t$subject = new Sample_Requirements();\n\n\t\tFunctionMocker::replace( &#039;phpversion&#039;, &#039;5.5&#039; );\n\t\t$this-&gt;assertFalse( $subject-&gt;is_php_version_required() );\n\n\t\tFunctionMocker::replace( &#039;phpversion&#039;, &#039;5.6&#039; );\n\t\t$this-&gt;assertTrue( $subject-&gt;is_php_version_required() );\n\t}\n}\n<\/pre><\/div>\n\n\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, <code>FunctionMocker<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439: \u0437\u0430\u043c\u0435\u043d\u0443 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, &#171;\u043f\u043e\u0434\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u043d\u0438\u0435&#187; \u0437\u0430 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u0437\u0430\u043c\u0435\u043d\u0443 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 ( \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>$wpdb-&gt;get_row<\/code> ) \u0438 \u0442.\u0434.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 PHPUnit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 PHP, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, phpversion().<\/p>\n","protected":false},"author":2,"featured_media":1204,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-7"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP - KAGG<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP - KAGG\" \/>\n<meta property=\"og:description\" content=\"\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 PHPUnit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 PHP, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, phpversion().\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"KAGG\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-25T11:39:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-25T17:28:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kagg.eu\/wp-content\/uploads\/2019\/08\/wise-monkeys.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1005\" \/>\n\t<meta property=\"og:image:height\" content=\"359\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"KAGG Design\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InfoKagg\" \/>\n<meta name=\"twitter:site\" content=\"@InfoKagg\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\" \/>\n\t<meta name=\"twitter:data1\" content=\"KAGG Design\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u043c\u0438\u043d\u0443\u0442\u0430\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/\"},\"author\":{\"name\":\"KAGG Design\",\"@id\":\"https:\\\/\\\/kagg.eu\\\/#\\\/schema\\\/person\\\/e1b6f0a782b23d65395927e728f8ea3b\"},\"headline\":\"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP\",\"datePublished\":\"2019-08-25T11:39:22+00:00\",\"dateModified\":\"2019-08-25T17:28:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/\"},\"wordCount\":186,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kagg.eu\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/wise-monkeys.jpg\",\"articleSection\":[\"\u0411\u043b\u043e\u0433\"],\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/\",\"url\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/\",\"name\":\"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP - KAGG\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kagg.eu\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/wise-monkeys.jpg\",\"datePublished\":\"2019-08-25T11:39:22+00:00\",\"dateModified\":\"2019-08-25T17:28:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/kagg.eu\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/wise-monkeys.jpg\",\"contentUrl\":\"https:\\\/\\\/kagg.eu\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/wise-monkeys.jpg\",\"width\":1005,\"height\":359},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kagg.eu\\\/phpunit-tests-of-code-with-php-internal-functions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\\\/\\\/kagg.eu\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kagg.eu\\\/#website\",\"url\":\"https:\\\/\\\/kagg.eu\\\/\",\"name\":\"KAGG\",\"description\":\"Web design and development\",\"publisher\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kagg.eu\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ru-RU\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/kagg.eu\\\/#organization\",\"name\":\"KAGG Innovative Web Design\",\"url\":\"https:\\\/\\\/kagg.eu\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/kagg.eu\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/kagg.eu\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/KAGG-design-logo@2X.png\",\"contentUrl\":\"https:\\\/\\\/kagg.eu\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/KAGG-design-logo@2X.png\",\"width\":500,\"height\":120,\"caption\":\"KAGG Innovative Web Design\"},\"image\":{\"@id\":\"https:\\\/\\\/kagg.eu\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/InfoKagg\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCLQAMcWCgsMo8x9m2EidPgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kagg.eu\\\/#\\\/schema\\\/person\\\/e1b6f0a782b23d65395927e728f8ea3b\",\"name\":\"KAGG Design\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1a01ea5d1d7e193cf308c8c5cea098775bdbaf2e2efb0c6af9309163bf111398?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1a01ea5d1d7e193cf308c8c5cea098775bdbaf2e2efb0c6af9309163bf111398?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1a01ea5d1d7e193cf308c8c5cea098775bdbaf2e2efb0c6af9309163bf111398?s=96&d=mm&r=g\",\"caption\":\"KAGG Design\"},\"sameAs\":[\"https:\\\/\\\/kagg.eu\"],\"url\":\"https:\\\/\\\/kagg.eu\\\/ru\\\/author\\\/kagg\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP - KAGG","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/","og_locale":"ru_RU","og_type":"article","og_title":"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP - KAGG","og_description":"\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 PHPUnit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 PHP, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, phpversion().","og_url":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/","og_site_name":"KAGG","article_published_time":"2019-08-25T11:39:22+00:00","article_modified_time":"2019-08-25T17:28:11+00:00","og_image":[{"width":1005,"height":359,"url":"https:\/\/kagg.eu\/wp-content\/uploads\/2019\/08\/wise-monkeys.jpg","type":"image\/jpeg"}],"author":"KAGG Design","twitter_card":"summary_large_image","twitter_creator":"@InfoKagg","twitter_site":"@InfoKagg","twitter_misc":{"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c":"KAGG Design","\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f":"1 \u043c\u0438\u043d\u0443\u0442\u0430"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/#article","isPartOf":{"@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/"},"author":{"name":"KAGG Design","@id":"https:\/\/kagg.eu\/#\/schema\/person\/e1b6f0a782b23d65395927e728f8ea3b"},"headline":"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP","datePublished":"2019-08-25T11:39:22+00:00","dateModified":"2019-08-25T17:28:11+00:00","mainEntityOfPage":{"@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/"},"wordCount":186,"commentCount":0,"publisher":{"@id":"https:\/\/kagg.eu\/#organization"},"image":{"@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/kagg.eu\/wp-content\/uploads\/2019\/08\/wise-monkeys.jpg","articleSection":["\u0411\u043b\u043e\u0433"],"inLanguage":"ru-RU","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/","url":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/","name":"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP - KAGG","isPartOf":{"@id":"https:\/\/kagg.eu\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/#primaryimage"},"image":{"@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/kagg.eu\/wp-content\/uploads\/2019\/08\/wise-monkeys.jpg","datePublished":"2019-08-25T11:39:22+00:00","dateModified":"2019-08-25T17:28:11+00:00","breadcrumb":{"@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/"]}]},{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/#primaryimage","url":"https:\/\/kagg.eu\/wp-content\/uploads\/2019\/08\/wise-monkeys.jpg","contentUrl":"https:\/\/kagg.eu\/wp-content\/uploads\/2019\/08\/wise-monkeys.jpg","width":1005,"height":359},{"@type":"BreadcrumbList","@id":"https:\/\/kagg.eu\/phpunit-tests-of-code-with-php-internal-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/kagg.eu\/"},{"@type":"ListItem","position":2,"name":"PHPUnit \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 PHP"}]},{"@type":"WebSite","@id":"https:\/\/kagg.eu\/#website","url":"https:\/\/kagg.eu\/","name":"KAGG","description":"Web design and development","publisher":{"@id":"https:\/\/kagg.eu\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kagg.eu\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ru-RU"},{"@type":"Organization","@id":"https:\/\/kagg.eu\/#organization","name":"KAGG Innovative Web Design","url":"https:\/\/kagg.eu\/","logo":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/kagg.eu\/#\/schema\/logo\/image\/","url":"https:\/\/kagg.eu\/wp-content\/uploads\/2016\/01\/KAGG-design-logo@2X.png","contentUrl":"https:\/\/kagg.eu\/wp-content\/uploads\/2016\/01\/KAGG-design-logo@2X.png","width":500,"height":120,"caption":"KAGG Innovative Web Design"},"image":{"@id":"https:\/\/kagg.eu\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/InfoKagg","https:\/\/www.youtube.com\/channel\/UCLQAMcWCgsMo8x9m2EidPgw"]},{"@type":"Person","@id":"https:\/\/kagg.eu\/#\/schema\/person\/e1b6f0a782b23d65395927e728f8ea3b","name":"KAGG Design","image":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/secure.gravatar.com\/avatar\/1a01ea5d1d7e193cf308c8c5cea098775bdbaf2e2efb0c6af9309163bf111398?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1a01ea5d1d7e193cf308c8c5cea098775bdbaf2e2efb0c6af9309163bf111398?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1a01ea5d1d7e193cf308c8c5cea098775bdbaf2e2efb0c6af9309163bf111398?s=96&d=mm&r=g","caption":"KAGG Design"},"sameAs":["https:\/\/kagg.eu"],"url":"https:\/\/kagg.eu\/ru\/author\/kagg\/"}]}},"_links":{"self":[{"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/posts\/1200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/comments?post=1200"}],"version-history":[{"count":3,"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/posts\/1200\/revisions"}],"predecessor-version":[{"id":1217,"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/posts\/1200\/revisions\/1217"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/media?parent=1200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/categories?post=1200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kagg.eu\/ru\/wp-json\/wp\/v2\/tags?post=1200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}