#44: show item name on orderitem editform
All checks were successful
/ ls (pull_request) Successful in 35s
/ ls (push) Successful in 36s
/ ls (release) Successful in 28s

This commit is contained in:
lubiana 2024-08-14 20:39:14 +02:00
parent 25b73e7da5
commit c324973d28
No known key found for this signature in database
3 changed files with 49 additions and 6 deletions

View file

@ -101,6 +101,31 @@ final class OrderItemControllerTest extends DbWebTest
self::assertSame(0, $this->repository->count([]));
}
public function testEdit(): void
{
$orderItem = new OrderItem;
$orderItem->setName('Testing');
$orderItem->setExtras('My Extra');
$orderItem->setFoodOrder($this->order);
$orderItem->setMenuItem($this->menuItem);
$this->manager->persist($orderItem);
$this->manager->flush();
$crawler = $this->client->request('GET', sprintf('%s%s/edit', $this->path, $orderItem->getId()));
$nameElem = $crawler->filter('#order_item_name');
$extrasElem = $crawler->filter('#order_item_extras');
$this->assertEquals(
'Testing',
$nameElem->attr('value')
);
$this->assertEquals(
'My Extra',
$extrasElem->attr('value')
);
}
public function testCopy(): void
{
$orderItem = new OrderItem;
@ -123,7 +148,6 @@ final class OrderItemControllerTest extends DbWebTest
$this->assertSame($orderItem->getName(), $item->getName());
$this->assertSame($orderItem->getExtras(), $item->getExtras());
}
}
#[Override]