wip: initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\BusProNet\DataLoader;
|
||||
|
||||
use App\BusProNet\DataLoader\HotelDataLoader;
|
||||
use App\BusProNet\Model\Hotel;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class HotelDataLoaderTest extends TestCase
|
||||
{
|
||||
public function testParse(): void
|
||||
{
|
||||
$loader = new HotelDataLoader(__DIR__.'/../../Resources');
|
||||
$hotelId = 163113;
|
||||
|
||||
$xml = $loader->loadById($hotelId, 'hotels_data.xml');
|
||||
$this->assertInstanceOf(\SimpleXMLElement::class, $xml);
|
||||
|
||||
$hotel = $loader->parseXml($xml);
|
||||
|
||||
$this->assertInstanceOf(Hotel::class, $hotel);
|
||||
$this->assertEquals($hotelId, $hotel->id);
|
||||
$this->assertEquals('L\'Oxalys', $hotel->name);
|
||||
$this->assertEquals('SBWOXA', $hotel->code);
|
||||
$this->assertEquals('Val Thorens', $hotel->city);
|
||||
$this->assertEquals('F', $hotel->country);
|
||||
$this->assertEquals('Rue des Lacs', $hotel->street);
|
||||
$this->assertEquals('', $hotel->phone);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user