for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mezon\Gui\Field\Tests;
use PHPUnit\Framework\TestCase;
use Mezon\Gui\Field\LabelField;
/**
*
* @psalm-suppress PropertyNotSetInConstructor
*/
class LabelFieldUnitTest extends TestCase
{
* Testing constructor
public function testConstructor(): void
// setup
$field = new LabelField([
'text' => 'name'
]);
// test body
$content = $field->html();
// assertions
$this->assertStringContainsString(
'<label class="control-label">name</label>',
$content,
'Label was not generated');
}
* Testing getType method
public function testGetType(): void
// test body and assertions
$this->assertStringContainsString('label', $field->getType());
* Testing fillAllRow method
public function testFillAllRow(): void
$this->assertTrue($field->fillAllRow());