Commit ffbf1e01 authored by Dainis Abols's avatar Dainis Abols
Browse files

Surname Test

parent 2a4455b5
<?php
declare(strict_types=1);
namespace Lu\LuContacts\Tests\Functional;
use Lu\LuApi\Helpers\DataHelper;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
/**
* List address test
*
* @author Dainis Abols <dainis.abols@lu.lv>
* @owner University of Latvia
* @since 02.03.2022
*/
class ListAddressTest extends UnitTestCase
{
protected $resetSingletonInstances = true;
/**
* Public API URL
*
* @var string
*/
private string $url = 'https://typo3-dev2.lu.lv/contacts';
/**
* @test
*/
public function testList()
{
// Read url
$url = $this->url.'?tx_lucontacts_pi1[action]=list&tx_lucontacts_pi1[listType]=address';
$result = (new DataHelper())->fetchUrl($url);
// Assert url read
$code = !empty($result) ? $result->getStatusCode() : 500;
$this->assertEquals(200, $code, 'Address list not loaded ['.$url.']');
// Assert html return
$content = @$result->getBody()->getContents();
$this->assertTrue(strpos($content, 'contact_frame') !== false, 'Address list has no data');
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment