{"id":466297,"date":"2025-07-07T15:31:28","date_gmt":"2025-07-07T15:31:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=466297"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=466297","title":{"rendered":"<span>\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 Pest \u2014 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 PHP-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c Pest \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0439, \u043d\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f PHP. \u041e\u043d \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043f\u043e\u0432\u0435\u0440\u0445 PHPUnit \u0438 \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432: \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435, \u0447\u0438\u0442\u0430\u0435\u043c\u0435\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435 \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435.<\/p>\n<p>Pest \u2014 \u043d\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 PHPUnit, \u0430 \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043d\u0430\u0434 \u043d\u0438\u043c. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 DSL, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u0432\u0441\u0435 \u0444\u0438\u0447\u0438 PHPUnit. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 PHPUnit-\u0444\u0438\u0447\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f assertions, \u043c\u043e\u043a-\u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0432 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435.<\/p>\n<h3>\u041a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/h3>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438: <code>test<\/code>, <code>it<\/code>, <code>expect<\/code>, \u0445\u0443\u043a\u0438 (<code>beforeEach<\/code>, <code>afterEach<\/code>, <code>beforeAll<\/code>, <code>afterAll<\/code>) \u0438 fluent-\u043c\u0435\u0442\u043e\u0434\u044b, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 <code>-&gt;with()<\/code>, <code>-&gt;skip()<\/code>, <code>-&gt;only()<\/code>, <code>-&gt;throws()<\/code> \u0438 \u0434\u0440.<\/p>\n<h4>test() \u0438 it(): \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b<\/h4>\n<pre><code class=\"php\">test('2 + 2 \u0440\u0430\u0432\u043d\u043e 4', function () {     expect(2 + 2)-&gt;toBe(4); });  it('\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 true \u0434\u043b\u044f \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430', function () {     $value = 10;     expect($value &gt; 0)-&gt;toBeTrue(); });<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 <code>test()<\/code> \u0438 <code>it()<\/code> \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f. <code>test()<\/code> \u0447\u0430\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u043b\u044f unit \u0438 feature-\u0442\u0435\u0441\u0442\u043e\u0432, <code>it()<\/code> \u2014 \u0434\u043b\u044f BDD-\u0441\u0442\u0438\u043b\u044f.<\/p>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><strong>string $description<\/strong> \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0430 (\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d)<\/p>\n<\/li>\n<li>\n<p><strong>Closure $closure<\/strong> \u2014 \u043b\u043e\u0433\u0438\u043a\u0430 \u0442\u0435\u0441\u0442\u0430, \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<h4>expect(): \u0445\u0435\u043b\u043f\u0435\u0440-\u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 assertions<\/h4>\n<p>\u0412 Pest \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 <code>assert*<\/code>-\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f fluent-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>expect(...)<\/code>, \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043b\u0435\u0436\u0430\u0442 matchers.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b:<\/p>\n<pre><code class=\"php\">expect($value)-&gt;toBe(42);                         \/\/ === expect($array)-&gt;toContain('foo');                 \/\/ in_array expect($text)-&gt;toStartWith('Hello');              \/\/ str_starts_with expect($response)-&gt;toThrow(SomeException::class); \/\/ expectException<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e <code>not()<\/code>:<\/p>\n<pre><code class=\"php\">expect($list)-&gt;not()-&gt;toContain('bar');<\/code><\/pre>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0442\u0447\u0435\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>toBe<\/code>, <code>toEqual<\/code>, <code>toMatchArray<\/code>, <code>toBeInstanceOf<\/code>, <code>toBeTrue<\/code>, <code>toBeFalse<\/code><\/p>\n<\/li>\n<li>\n<p><code>toContain<\/code>, <code>toStartWith<\/code>, <code>toEndWith<\/code>, <code>toHaveCount<\/code>, <code>toBeEmpty<\/code>, <code>toBeNull<\/code><\/p>\n<\/li>\n<li>\n<p><code>toThrow<\/code>, <code>toThrow(fn($e) =&gt; $e-&gt;getCode() === 403)<\/code> \u2014 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<li>\n<p><code>not()<\/code> \u2014 \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0442\u0447<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 matchers.<\/p>\n<h4>\u0425\u0443\u043a\u0438: beforeEach, beforeAll \u0438 \u0434\u0440\u0443\u0433\u0438\u0435<\/h4>\n<p>Pest \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 familiar-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0445\u0443\u043a\u0438. \u041e\u043d\u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c <code>setUp()<\/code> \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435.<\/p>\n<pre><code class=\"php\">beforeEach(function () {     $this-&gt;user = User::factory()-&gt;create(); });  afterEach(function () {     \/\/ clean up });<\/code><\/pre>\n<p>\u0415\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u0442\u0438\u043f\u0430 \u0445\u0443\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>beforeEach()<\/code> \u2014 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0444\u0430\u0439\u043b\u0430<\/p>\n<\/li>\n<li>\n<p><code>afterEach()<\/code> \u2014 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><code>beforeAll()<\/code> \/ <code>afterAll()<\/code> \u2014 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043d\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430 \u0432\u0435\u0441\u044c \u0444\u0430\u0439\u043b<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 <code>Closure<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043a\u0430\u043a <code>$this<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 TestCase, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <code>uses(...)-&gt;in(...)<\/code>.<\/p>\n<h4>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430: describe() \u0438 dataset()<\/h4>\n<p>\u0414\u043b\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>describe()<\/code>:<\/p>\n<pre><code class=\"php\">describe('User API', function () {     beforeEach(function () {         $this-&gt;user = User::factory()-&gt;create();     });      it('\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 200', function () {         $response = $this-&gt;getJson(\"\/api\/users\/{$this-&gt;user-&gt;id}\");         $response-&gt;assertOk();     });      it('\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f', function () {         $response = $this-&gt;getJson(\"\/api\/users\/{$this-&gt;user-&gt;id}\");         expect($response['name'])-&gt;toBe($this-&gt;user-&gt;name);     }); });<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>describe()<\/code> \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u043a\u043e\u0443\u043f \u0441 shared-\u0445\u0443\u043a\u0430\u043c\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<h4>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>Pest \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 <code>-&gt;with(...)<\/code>.<\/p>\n<pre><code class=\"php\">it('\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 2', function ($number) {     expect($number % 2)-&gt;toBe(0); })-&gt;with([2, 4, 6]);<\/code><\/pre>\n<p>\u041a\u0435\u0439\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"php\">-&gt;with([     '\u0434\u0432\u043e\u0439\u043a\u0430' =&gt; 2,     '\u0447\u0435\u0442\u0432\u0451\u0440\u043a\u0430' =&gt; 4,     '\u0448\u0435\u0441\u0442\u0451\u0440\u043a\u0430' =&gt; 6, ])<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f: <code>dataset(...)<\/code><\/p>\n<pre><code class=\"php\">dataset('even numbers', [2, 4, 6]);  it('\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 2', function ($number) {     expect($number % 2)-&gt;toBe(0); })-&gt;with('even numbers');<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u044b:<\/p>\n<pre><code class=\"php\">dataset('\u0441\u043b\u0430\u0439\u0434\u044b', function () {     yield '\u0441\u043b\u0430\u0439\u0434 1' =&gt; ['title' =&gt; 'Intro'];     yield '\u0441\u043b\u0430\u0439\u0434 2' =&gt; ['title' =&gt; 'Overview']; });<\/code><\/pre>\n<h4>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c<\/h4>\n<p>Pest \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 fluent-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>-&gt;skip()<\/code> \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u0441\u0442<\/p>\n<\/li>\n<li>\n<p><code>-&gt;only()<\/code> \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442<\/p>\n<\/li>\n<li>\n<p><code>-&gt;throws(...)<\/code> \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><code>-&gt;repeat(n)<\/code> \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u0435\u0441\u0442 n \u0440\u0430\u0437<\/p>\n<\/li>\n<li>\n<p><code>-&gt;depends(...)<\/code> \u2014 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"php\">test('\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d')-&gt;skip();  test('\u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435', function () {     throw new InvalidArgumentException(); })-&gt;throws(InvalidArgumentException::class); <\/code><\/pre>\n<h4>\u041a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 matchers \u0438 expectations<\/h4>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 DSL \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>expect()-&gt;extend()<\/code>:<\/p>\n<pre><code class=\"php\">expect()-&gt;extend('toBeEven', function () {     return $this-&gt;toBeInt()-&gt;and($this-&gt;value % 2 === 0); });  test('42 \u2014 \u0447\u0451\u0442\u043d\u043e\u0435', function () {     expect(42)-&gt;toBeEven(); });<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0440\u0430\u0449\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u0441\u0442\u0438\u043b\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<h3>\u0413\u0434\u0435 \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442<\/h3>\n<h4>\u042e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0431\u0435\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <code>User-&gt;isAdult()<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>true<\/code> \u043f\u0440\u0438 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0435 \u226518.<\/p>\n<pre><code class=\"php\">test('\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u043b\u0435\u0442\u043d\u0438\u0439', function () {     $user = new User(age: 20);     expect($user-&gt;isAdult())-&gt;toBeTrue(); });<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u044e\u043d\u0438\u0442 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c.<\/p>\n<h4>\u0422\u0435\u0441\u0442 API-\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 Laravel HTTP Kernel<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e <code>\/api\/posts<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>200 OK<\/code> \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 JSON-\u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<pre><code class=\"php\">test('GET \/api\/posts \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a', function () {     Post::factory()-&gt;count(3)-&gt;create();      $response = $this-&gt;getJson('\/api\/posts');      $response-&gt;assertOk();     $response-&gt;assertJsonIsArray(); });<\/code><\/pre>\n<p><code>$this<\/code> \u2014 \u044d\u0442\u043e Laravel TestCase, \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d <code>uses(Tests\\TestCase::class)-&gt;in(...)<\/code>. Pest \u0443\u043c\u0435\u0435\u0442 \u0432 DI \u0438 Laravel-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.<\/p>\n<h4>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>isPalindrome(string $input)<\/code> \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0435\u0439\u0441\u0430\u0445.<\/p>\n<pre><code class=\"php\">function isPalindrome(string $input): bool {     return strrev($input) === $input; }  it('\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u044b', function ($word, $expected) {     expect(isPalindrome($word))-&gt;toBe($expected); })-&gt;with([     ['level', true],     ['racecar', true],     ['hello', false],     ['radar', true], ]);<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 <code>with()<\/code>, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0435\u0439\u0441\u043e\u0432.<\/p>\n<h4>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043c\u0435\u0442\u043e\u0434 <code>Account-&gt;withdraw()<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c <code>InsufficientFundsException<\/code>, \u0435\u0441\u043b\u0438 \u0431\u0430\u043b\u0430\u043d\u0441 &lt; \u0441\u0443\u043c\u043c\u044b \u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"php\">test('\u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432', function () {     $account = new Account(balance: 100);      $account-&gt;withdraw(200); })-&gt;throws(InsufficientFundsException::class); <\/code><\/pre>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f <code>throws(Class::class)<\/code> \u0438 <code>throws(fn(Exception $e) =&gt; $e-&gt;getCode() === 403)<\/code>.<\/p>\n<h4>\u0422\u0435\u0441\u0442 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 Laravel DI<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e <code>TimeService<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 <code>Carbon<\/code>.<\/p>\n<pre><code class=\"php\">test('TimeService \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Carbon', function (TimeService $service) {     $now = $service-&gt;now();      expect($now)-&gt;toBeInstanceOf(Carbon::class); });<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 <code>TimeService<\/code> \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 Laravel-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u2014 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u0451\u043d \u0432 \u0442\u0435\u0441\u0442 \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442.<\/p>\n<h4>\u0425\u0443\u043a\u0438 \u0438 \u0448\u0430\u0440\u0438\u043d\u0433 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u0441\u0442\u0430\u043c\u0438<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0441\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<pre><code class=\"php\">beforeEach(function () {     $this-&gt;post = Post::factory()-&gt;create([         'title' =&gt; 'Hello World',     ]); });  test('\u043f\u043e\u0441\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442', function () {     expect($this-&gt;post)-&gt;not()-&gt;toBeNull(); });  test('\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439', function () {     expect($this-&gt;post-&gt;title)-&gt;toBe('Hello World'); });<\/code><\/pre>\n<p>\u0423\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043e\u0431\u0449\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0438 \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0431\u0440\u0438\u043a.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e matcher&#8217;\u0430<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0447\u0451\u0442\u043d\u043e\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 DSL.<\/p>\n<pre><code class=\"php\">expect()-&gt;extend('toBeEven', function () {     return $this-&gt;value % 2 === 0; });  test('42 \u2014 \u0447\u0451\u0442\u043d\u043e\u0435', function () {     expect(42)-&gt;toBeEven(); });<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 DSL.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0447\u0435\u0440\u0435\u0437 mock-\u043e\u0431\u044a\u0435\u043a\u0442<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e <code>Mailer-&gt;send()<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<pre><code class=\"php\">test('\u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f', function () {     $mailer = Mockery::mock(Mailer::class);     $mailer-&gt;shouldReceive('send')         -&gt;once()         -&gt;with('user@example.com', Mockery::type(Message::class));      $notifier = new Notifier($mailer);     $notifier-&gt;notify('user@example.com'); }); <\/code><\/pre>\n<p>Pest \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 Mockery \u0438 \u043b\u044e\u0431\u044b\u043c\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438.<\/p>\n<h4>UI \u0438 Browser \u0442\u0435\u0441\u0442\u044b <\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442.<\/p>\n<pre><code class=\"php\">test('\u043a\u043d\u043e\u043f\u043a\u0430 \"\u0412\u043e\u0439\u0442\u0438\" \u0435\u0441\u0442\u044c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439', function () {     $this-&gt;browse(function ($browser) {         $browser-&gt;visit('\/')                 -&gt;assertSee('\u0412\u043e\u0439\u0442\u0438');     }); });<\/code><\/pre>\n<p>Pest \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 Laravel Dusk \u2014 \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e TestCase.<\/p>\n<hr\/>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>Pest \u2014 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 DSL-\u0441\u043b\u043e\u0439 \u043f\u043e\u0432\u0435\u0440\u0445 PHPUnit, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0437\u0430 \u0441\u0447\u0451\u0442 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0442\u0447\u0435\u0440\u043e\u0432, \u0445\u0443\u043a\u043e\u0432 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438; \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a \u0434\u043b\u044f unit-, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0438 e2e-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u043b\u0435\u0433\u043a\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 Laravel-\u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438 CI-\u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u044b, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 Mockery, Dusk \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c; \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0435\u0439\u0441\u044b \u0438\u043b\u0438 \u0433\u0440\u0430\u0431\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0440\u0430\u0437\u0433\u0440\u0435\u0431\u0430\u043b\u0438 \u0441 Pest, \u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<hr\/>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441\u00a0PHPUnit \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b\u00a0\u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0438\u0449\u0435 \u0438 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435\u00a0\u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0435\u00a0\u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u00a0Pest, \u043d\u043e\u00a0\u0438 \u043d\u0430\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0440\u043e\u0441\u0442 \u0432\u00a0\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 PHP\u2011\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.<\/p>\n<p>16 \u0438\u044e\u043b\u044f \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a <a href=\"https:\/\/otus.pw\/v6v8T\/\" rel=\"noopener noreferrer nofollow\">\u00ab\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0442\u044c \u0442\u0438\u043c\u043b\u0438\u0434\u043e\u043c \u043d\u0430\u00a0PHP\u00bb<\/a> \u0432\u00a0\u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 PHP Developer. Professional. \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a\u00a0\u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u043a\u0443\u0440\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00a0\u2014 \u043e\u0442\u00a0\u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043e\u00a0\u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<p>\u0410\u00a0\u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0443\u0440\u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0430\u043c, \u043d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441\u00a0\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e <a href=\"https:\/\/otus.pw\/1qH1\/\" rel=\"noopener noreferrer nofollow\">\u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/923170\/\"> https:\/\/habr.com\/ru\/articles\/923170\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c Pest \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0439, \u043d\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f PHP. \u041e\u043d \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043f\u043e\u0432\u0435\u0440\u0445 PHPUnit \u0438 \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432: \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435, \u0447\u0438\u0442\u0430\u0435\u043c\u0435\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435 \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435.<\/p>\n<p>Pest \u2014 \u043d\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 PHPUnit, \u0430 \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043d\u0430\u0434 \u043d\u0438\u043c. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 DSL, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u0432\u0441\u0435 \u0444\u0438\u0447\u0438 PHPUnit. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 PHPUnit-\u0444\u0438\u0447\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f assertions, \u043c\u043e\u043a-\u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0432 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435.<\/p>\n<h3>\u041a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/h3>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438: <code>test<\/code>, <code>it<\/code>, <code>expect<\/code>, \u0445\u0443\u043a\u0438 (<code>beforeEach<\/code>, <code>afterEach<\/code>, <code>beforeAll<\/code>, <code>afterAll<\/code>) \u0438 fluent-\u043c\u0435\u0442\u043e\u0434\u044b, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 <code>-&gt;with()<\/code>, <code>-&gt;skip()<\/code>, <code>-&gt;only()<\/code>, <code>-&gt;throws()<\/code> \u0438 \u0434\u0440.<\/p>\n<h4>test() \u0438 it(): \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b<\/h4>\n<pre><code class=\"php\">test('2 + 2 \u0440\u0430\u0432\u043d\u043e 4', function () {     expect(2 + 2)-&gt;toBe(4); });  it('\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 true \u0434\u043b\u044f \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430', function () {     $value = 10;     expect($value &gt; 0)-&gt;toBeTrue(); });<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 <code>test()<\/code> \u0438 <code>it()<\/code> \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f. <code>test()<\/code> \u0447\u0430\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u043b\u044f unit \u0438 feature-\u0442\u0435\u0441\u0442\u043e\u0432, <code>it()<\/code> \u2014 \u0434\u043b\u044f BDD-\u0441\u0442\u0438\u043b\u044f.<\/p>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><strong>string $description<\/strong> \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0430 (\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d)<\/p>\n<\/li>\n<li>\n<p><strong>Closure $closure<\/strong> \u2014 \u043b\u043e\u0433\u0438\u043a\u0430 \u0442\u0435\u0441\u0442\u0430, \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<h4>expect(): \u0445\u0435\u043b\u043f\u0435\u0440-\u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 assertions<\/h4>\n<p>\u0412 Pest \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 <code>assert*<\/code>-\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f fluent-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>expect(...)<\/code>, \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043b\u0435\u0436\u0430\u0442 matchers.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b:<\/p>\n<pre><code class=\"php\">expect($value)-&gt;toBe(42);                         \/\/ === expect($array)-&gt;toContain('foo');                 \/\/ in_array expect($text)-&gt;toStartWith('Hello');              \/\/ str_starts_with expect($response)-&gt;toThrow(SomeException::class); \/\/ expectException<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e <code>not()<\/code>:<\/p>\n<pre><code class=\"php\">expect($list)-&gt;not()-&gt;toContain('bar');<\/code><\/pre>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0442\u0447\u0435\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>toBe<\/code>, <code>toEqual<\/code>, <code>toMatchArray<\/code>, <code>toBeInstanceOf<\/code>, <code>toBeTrue<\/code>, <code>toBeFalse<\/code><\/p>\n<\/li>\n<li>\n<p><code>toContain<\/code>, <code>toStartWith<\/code>, <code>toEndWith<\/code>, <code>toHaveCount<\/code>, <code>toBeEmpty<\/code>, <code>toBeNull<\/code><\/p>\n<\/li>\n<li>\n<p><code>toThrow<\/code>, <code>toThrow(fn($e) =&gt; $e-&gt;getCode() === 403)<\/code> \u2014 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<li>\n<p><code>not()<\/code> \u2014 \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0442\u0447<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 matchers.<\/p>\n<h4>\u0425\u0443\u043a\u0438: beforeEach, beforeAll \u0438 \u0434\u0440\u0443\u0433\u0438\u0435<\/h4>\n<p>Pest \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 familiar-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0445\u0443\u043a\u0438. \u041e\u043d\u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c <code>setUp()<\/code> \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435.<\/p>\n<pre><code class=\"php\">beforeEach(function () {     $this-&gt;user = User::factory()-&gt;create(); });  afterEach(function () {     \/\/ clean up });<\/code><\/pre>\n<p>\u0415\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u0442\u0438\u043f\u0430 \u0445\u0443\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>beforeEach()<\/code> \u2014 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0444\u0430\u0439\u043b\u0430<\/p>\n<\/li>\n<li>\n<p><code>afterEach()<\/code> \u2014 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><code>beforeAll()<\/code> \/ <code>afterAll()<\/code> \u2014 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043d\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430 \u0432\u0435\u0441\u044c \u0444\u0430\u0439\u043b<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 <code>Closure<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043a\u0430\u043a <code>$this<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 TestCase, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <code>uses(...)-&gt;in(...)<\/code>.<\/p>\n<h4>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430: describe() \u0438 dataset()<\/h4>\n<p>\u0414\u043b\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>describe()<\/code>:<\/p>\n<pre><code class=\"php\">describe('User API', function () {     beforeEach(function () {         $this-&gt;user = User::factory()-&gt;create();     });      it('\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 200', function () {         $response = $this-&gt;getJson(\"\/api\/users\/{$this-&gt;user-&gt;id}\");         $response-&gt;assertOk();     });      it('\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f', function () {         $response = $this-&gt;getJson(\"\/api\/users\/{$this-&gt;user-&gt;id}\");         expect($response['name'])-&gt;toBe($this-&gt;user-&gt;name);     }); });<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>describe()<\/code> \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u043a\u043e\u0443\u043f \u0441 shared-\u0445\u0443\u043a\u0430\u043c\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<h4>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>Pest \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 <code>-&gt;with(...)<\/code>.<\/p>\n<pre><code class=\"php\">it('\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 2', function ($number) {     expect($number % 2)-&gt;toBe(0); })-&gt;with([2, 4, 6]);<\/code><\/pre>\n<p>\u041a\u0435\u0439\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"php\">-&gt;with([     '\u0434\u0432\u043e\u0439\u043a\u0430' =&gt; 2,     '\u0447\u0435\u0442\u0432\u0451\u0440\u043a\u0430' =&gt; 4,     '\u0448\u0435\u0441\u0442\u0451\u0440\u043a\u0430' =&gt; 6, ])<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f: <code>dataset(...)<\/code><\/p>\n<pre><code class=\"php\">dataset('even numbers', [2, 4, 6]);  it('\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 2', function ($number) {     expect($number % 2)-&gt;toBe(0); })-&gt;with('even numbers');<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u044b:<\/p>\n<pre><code class=\"php\">dataset('\u0441\u043b\u0430\u0439\u0434\u044b', function () {     yield '\u0441\u043b\u0430\u0439\u0434 1' =&gt; ['title' =&gt; 'Intro'];     yield '\u0441\u043b\u0430\u0439\u0434 2' =&gt; ['title' =&gt; 'Overview']; });<\/code><\/pre>\n<h4>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c<\/h4>\n<p>Pest \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 fluent-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>-&gt;skip()<\/code> \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u0441\u0442<\/p>\n<\/li>\n<li>\n<p><code>-&gt;only()<\/code> \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442<\/p>\n<\/li>\n<li>\n<p><code>-&gt;throws(...)<\/code> \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><code>-&gt;repeat(n)<\/code> \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u0435\u0441\u0442 n \u0440\u0430\u0437<\/p>\n<\/li>\n<li>\n<p><code>-&gt;depends(...)<\/code> \u2014 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"php\">test('\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d')-&gt;skip();  test('\u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435', function () {     throw new InvalidArgumentException(); })-&gt;throws(InvalidArgumentException::class); <\/code><\/pre>\n<h4>\u041a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 matchers \u0438 expectations<\/h4>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 DSL \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>expect()-&gt;extend()<\/code>:<\/p>\n<pre><code class=\"php\">expect()-&gt;extend('toBeEven', function () {     return $this-&gt;toBeInt()-&gt;and($this-&gt;value % 2 === 0); });  test('42 \u2014 \u0447\u0451\u0442\u043d\u043e\u0435', function () {     expect(42)-&gt;toBeEven(); });<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0440\u0430\u0449\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u0441\u0442\u0438\u043b\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<h3>\u0413\u0434\u0435 \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442<\/h3>\n<h4>\u042e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0431\u0435\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <code>User-&gt;isAdult()<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>true<\/code> \u043f\u0440\u0438 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0435 \u226518.<\/p>\n<pre><code class=\"php\">test('\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u043b\u0435\u0442\u043d\u0438\u0439', function () {     $user = new User(age: 20);     expect($user-&gt;isAdult())-&gt;toBeTrue(); });<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u044e\u043d\u0438\u0442 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c.<\/p>\n<h4>\u0422\u0435\u0441\u0442 API-\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 Laravel HTTP Kernel<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e <code>\/api\/posts<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>200 OK<\/code> \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 JSON-\u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<pre><code class=\"php\">test('GET \/api\/posts \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a', function () {     Post::factory()-&gt;count(3)-&gt;create();      $response = $this-&gt;getJson('\/api\/posts');      $response-&gt;assertOk();     $response-&gt;assertJsonIsArray(); });<\/code><\/pre>\n<p><code>$this<\/code> \u2014 \u044d\u0442\u043e Laravel TestCase, \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d <code>uses(Tests\\TestCase::class)-&gt;in(...)<\/code>. Pest \u0443\u043c\u0435\u0435\u0442 \u0432 DI \u0438 Laravel-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.<\/p>\n<h4>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>isPalindrome(string $input)<\/code> \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0435\u0439\u0441\u0430\u0445.<\/p>\n<pre><code class=\"php\">function isPalindrome(string $input): bool {     return strrev($input) === $input; }  it('\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u044b', function ($word, $expected) {     expect(isPalindrome($word))-&gt;toBe($expected); })-&gt;with([     ['level', true],     ['racecar', true],     ['hello', false],     ['radar', true], ]);<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 <code>with()<\/code>, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0435\u0439\u0441\u043e\u0432.<\/p>\n<h4>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043c\u0435\u0442\u043e\u0434 <code>Account-&gt;withdraw()<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c <code>InsufficientFundsException<\/code>, \u0435\u0441\u043b\u0438 \u0431\u0430\u043b\u0430\u043d\u0441 &lt; \u0441\u0443\u043c\u043c\u044b \u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"php\">test('\u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432', function () {     $account = new Account(balance: 100);      $account-&gt;withdraw(200); })-&gt;throws(InsufficientFundsException::class); <\/code><\/pre>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f <code>throws(Class::class)<\/code> \u0438 <code>throws(fn(Exception $e) =&gt; $e-&gt;getCode() === 403)<\/code>.<\/p>\n<h4>\u0422\u0435\u0441\u0442 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 Laravel DI<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e <code>TimeService<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 <code>Carbon<\/code>.<\/p>\n<pre><code class=\"php\">test('TimeService \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Carbon', function (TimeService $service) {     $now = $service-&gt;now();      expect($now)-&gt;toBeInstanceOf(Carbon::class); });<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 <code>TimeService<\/code> \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 Laravel-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u2014 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u0451\u043d \u0432 \u0442\u0435\u0441\u0442 \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442.<\/p>\n<h4>\u0425\u0443\u043a\u0438 \u0438 \u0448\u0430\u0440\u0438\u043d\u0433 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u0441\u0442\u0430\u043c\u0438<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0441\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<pre><code class=\"php\">beforeEach(function () {     $this-&gt;post = Post::factory()-&gt;create([         'title' =&gt; 'Hello World',     ]); });  test('\u043f\u043e\u0441\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442', function () {     expect($this-&gt;post)-&gt;not()-&gt;toBeNull(); });  test('\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439', function () {     expect($this-&gt;post-&gt;title)-&gt;toBe('Hello World'); });<\/code><\/pre>\n<p>\u0423\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043e\u0431\u0449\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0438 \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0431\u0440\u0438\u043a.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e matcher&#8217;\u0430<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0447\u0451\u0442\u043d\u043e\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 DSL.<\/p>\n<pre><code class=\"php\">expect()-&gt;extend('toBeEven', function () {     return $this-&gt;value % 2 === 0; });  test('42 \u2014 \u0447\u0451\u0442\u043d\u043e\u0435', function () {     expect(42)-&gt;toBeEven(); });<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 DSL.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0447\u0435\u0440\u0435\u0437 mock-\u043e\u0431\u044a\u0435\u043a\u0442<\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e <code>Mailer-&gt;send()<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<pre><code class=\"php\">test('\u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f', function () {     $mailer = Mockery::mock(Mailer::class);     $mailer-&gt;shouldReceive('send')         -&gt;once()         -&gt;with('user@example.com', Mockery::type(Message::class));      $notifier = new Notifier($mailer);     $notifier-&gt;notify('user@example.com'); }); <\/code><\/pre>\n<p>Pest \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 Mockery \u0438 \u043b\u044e\u0431\u044b\u043c\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438.<\/p>\n<h4>UI \u0438 Browser \u0442\u0435\u0441\u0442\u044b <\/h4>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430:<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442.<\/p>\n<pre><code class=\"php\">test('\u043a\u043d\u043e\u043f\u043a\u0430 \"\u0412\u043e\u0439\u0442\u0438\" \u0435\u0441\u0442\u044c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439', function () {     $this-&gt;browse(function ($browser) {         $browser-&gt;visit('\/')                 -&gt;assertSee('\u0412\u043e\u0439\u0442\u0438');     }); });<\/code><\/pre>\n<p>Pest \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 Laravel Dusk \u2014 \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e TestCase.<\/p>\n<hr\/>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>Pest \u2014 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 DSL-\u0441\u043b\u043e\u0439 \u043f\u043e\u0432\u0435\u0440\u0445 PHPUnit, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0437\u0430 \u0441\u0447\u0451\u0442 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0442\u0447\u0435\u0440\u043e\u0432, \u0445\u0443\u043a\u043e\u0432 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438; \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a \u0434\u043b\u044f unit-, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0438 e2e-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u043b\u0435\u0433\u043a\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 Laravel-\u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438 CI-\u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u044b, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 Mockery, Dusk \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c; \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0435\u0439\u0441\u044b \u0438\u043b\u0438 \u0433\u0440\u0430\u0431\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0440\u0430\u0437\u0433\u0440\u0435\u0431\u0430\u043b\u0438 \u0441 Pest, \u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<hr\/>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441\u00a0PHPUnit \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b\u00a0\u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0438\u0449\u0435 \u0438 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435\u00a0\u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0435\u00a0\u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u00a0Pest, \u043d\u043e\u00a0\u0438 \u043d\u0430\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0440\u043e\u0441\u0442 \u0432\u00a0\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 PHP\u2011\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.<\/p>\n<p>16 \u0438\u044e\u043b\u044f \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a <a href=\"https:\/\/otus.pw\/v6v8T\/\" rel=\"noopener noreferrer nofollow\">\u00ab\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0442\u044c \u0442\u0438\u043c\u043b\u0438\u0434\u043e\u043c \u043d\u0430\u00a0PHP\u00bb<\/a> \u0432\u00a0\u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 PHP Developer. Professional. \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a\u00a0\u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u043a\u0443\u0440\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00a0\u2014 \u043e\u0442\u00a0\u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043e\u00a0\u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<p>\u0410\u00a0\u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0443\u0440\u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0430\u043c, \u043d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441\u00a0\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e <a href=\"https:\/\/otus.pw\/1qH1\/\" rel=\"noopener noreferrer nofollow\">\u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/923170\/\"> https:\/\/habr.com\/ru\/articles\/923170\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-466297","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/466297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=466297"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/466297\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=466297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=466297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=466297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}