Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
tombrain committed Nov 5, 2023
1 parent 3df98e7 commit 1a528ad
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/uts/formhandler_BrowserFieldTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

declare(strict_types=1);

final class formhandler_BrowserFieldTest extends FormhandlerTestCase
{
public function test_new(): void
{
$form = new FormHandler();

$form->browserField("BrowserField", "browserfield", "a/path");

$this->assertFormFlushContains($form, [
'BrowserField:<input type="text" name="browserfield" id="browserfield" value="" size="20" /> <input type="button" name="Bladeren" id="Bladeren" value="Bladeren"',
'onclick="window.open(',
'FHTML/filemanager/browser/default/browser.html?Type=File&naam=browserfield&Connector=../../connectors/php/connector.php?ServerPath=a/path\',\'\',\'modal=yes,width=650,height=400\');" /> error_browserfield'
]);
}

public function test_viewmode(): void
{
$form = new FormHandler();

$form->browserField("BrowserField", "browserfield", "a/path");
$form->setFieldViewMode("browserfield");

$this->assertFormFlushContains($form, [
'BrowserField:error_browserfield'
]);
}

public function test_posted(): void
{
$_POST['FormHandler_submit'] = "1";
$_POST['browserfield'] = "o1";

$form = new FormHandler();

$form->browserField("BrowserField", "browserfield", "a/path");

$this->assertEquals("o1", $form->getValue("browserfield"));

$this->assertTrue($form->isCorrect());
}


};

0 comments on commit 1a528ad

Please sign in to comment.