-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAssertableFormTest.php
More file actions
44 lines (34 loc) · 1.62 KB
/
AssertableFormTest.php
File metadata and controls
44 lines (34 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
declare(strict_types=1);
namespace Ziadoz\AssertableHtml\Tests\Integration;
use PHPUnit\Framework\TestCase;
use Ziadoz\AssertableHtml\Dom\AssertableDocument;
class AssertableFormTest extends TestCase
{
public function test_assertable_form(): void
{
// Form Methods
AssertableDocument::createFromString('<form method="GET"></form>', LIBXML_HTML_NOIMPLIED)
->querySelector('form')
->assertMethodGet();
AssertableDocument::createFromString('<form method="POST"></form>', LIBXML_HTML_NOIMPLIED)
->querySelector('form')
->assertMethodPost();
AssertableDocument::createFromString('<form method="DIALOG"></form>', LIBXML_HTML_NOIMPLIED)
->querySelector('form')
->assertMethodDialog();
AssertableDocument::createFromString('<form><input type="hidden" name="_method" value="PUT"></form>', LIBXML_HTML_NOIMPLIED)
->querySelector('form')
->assertMethodPut();
AssertableDocument::createFromString('<form><input type="hidden" name="_method" value="PATCH"></form>', LIBXML_HTML_NOIMPLIED)
->querySelector('form')
->assertMethodPatch();
AssertableDocument::createFromString('<form><input type="hidden" name="_method" value="DELETE"></form>', LIBXML_HTML_NOIMPLIED)
->querySelector('form')
->assertMethodDelete();
// Form Uploads
AssertableDocument::createFromString('<form enctype="multipart/form-data"><input type="file"></form>', LIBXML_HTML_NOIMPLIED)
->querySelector('form')
->assertAcceptsUpload();
}
}