refactor items table
This commit is contained in:
parent
836fb96f42
commit
8ab469e017
4 changed files with 56 additions and 22 deletions
|
@ -32,7 +32,7 @@ class ItemTest extends TestCase
|
|||
|
||||
$this->assertResponseOk();
|
||||
$this->assertEquals(1, count($response));
|
||||
$this->assertEquals(1, $response[0]['item_uid']);
|
||||
$this->assertEquals(1, $response[0]['uid']);
|
||||
$this->assertEquals('1', $response[0]['description']);
|
||||
$this->assertEquals($box->name, $response[0]['box']);
|
||||
$this->assertEquals($box->cid, $response[0]['cid']);
|
||||
|
@ -51,7 +51,7 @@ class ItemTest extends TestCase
|
|||
|
||||
$this->assertResponseOk();
|
||||
$this->assertEquals(1, count($response));
|
||||
$this->assertEquals(1, $response[0]['item_uid']);
|
||||
$this->assertEquals(1, $response[0]['uid']);
|
||||
$this->assertEquals('1', $response[0]['description']);
|
||||
$this->assertEquals($box->name, $response[0]['box']);
|
||||
$this->assertEquals($box->cid, $response[0]['cid']);
|
||||
|
@ -81,7 +81,7 @@ class ItemTest extends TestCase
|
|||
$response = $this->response->getOriginalContent();
|
||||
|
||||
$this->assertResponseStatus(201);
|
||||
$this->assertEquals(1, $response['item_uid']);
|
||||
$this->assertEquals(1, $response['uid']);
|
||||
$this->assertEquals('1', $response['description']);
|
||||
$this->assertEquals($box->name, $response['box']);
|
||||
$this->assertEquals($box->cid, $response['cid']);
|
||||
|
@ -89,7 +89,7 @@ class ItemTest extends TestCase
|
|||
|
||||
$items = Item::all();
|
||||
$this->assertEquals(1, count($items));
|
||||
$this->assertEquals(1, $items[0]['item_uid']);
|
||||
$this->assertEquals(1, $items[0]['uid']);
|
||||
$this->assertEquals('1', $items[0]['description']);
|
||||
$this->assertEquals($box->name, $items[0]['box']);
|
||||
$this->assertEquals($box->cid, $items[0]['cid']);
|
||||
|
@ -112,15 +112,15 @@ class ItemTest extends TestCase
|
|||
$box = Container::create(['name'=>'BOX']);
|
||||
$item = Item::create(['cid'=>$box->cid, 'eid' => $event->eid, 'wann'=>'', 'wo'=>'','description'=>'1']);
|
||||
|
||||
$this->assertEquals(1, $item['item_uid']);
|
||||
$this->assertEquals(1, $item['uid']);
|
||||
$this->assertEquals('1', $item['description']);
|
||||
$this->assertEquals($box->cid, $item['cid']);
|
||||
|
||||
$this->put('/1/EVENT/item/'.$item->item_uid,['description'=>'2']);
|
||||
$this->put('/1/EVENT/item/'.$item->uid,['description'=>'2']);
|
||||
$response = $this->response->getOriginalContent();
|
||||
|
||||
$this->assertResponseOk();
|
||||
$this->assertEquals(1, $response['item_uid']);
|
||||
$this->assertEquals(1, $response['uid']);
|
||||
$this->assertEquals('2', $response['description']);
|
||||
$this->assertEquals($box->name, $response['box']);
|
||||
$this->assertEquals($box->cid, $response['cid']);
|
||||
|
@ -128,7 +128,7 @@ class ItemTest extends TestCase
|
|||
|
||||
$items = Item::all();
|
||||
$this->assertEquals(1, count($items));
|
||||
$this->assertEquals(1, $items[0]['item_uid']);
|
||||
$this->assertEquals(1, $items[0]['uid']);
|
||||
$this->assertEquals('2', $items[0]['description']);
|
||||
$this->assertEquals($box->name, $items[0]['box']);
|
||||
$this->assertEquals($box->cid, $items[0]['cid']);
|
||||
|
@ -143,7 +143,7 @@ class ItemTest extends TestCase
|
|||
|
||||
$this->assertEquals(2, count(Item::all()));
|
||||
|
||||
$this->delete('/1/EVENT/item/'.$item->item_uid);
|
||||
$this->delete('/1/EVENT/item/'.$item->uid);
|
||||
|
||||
$this->assertResponseOk();
|
||||
$this->assertEquals(1, count(Item::all()));
|
||||
|
@ -158,17 +158,17 @@ class ItemTest extends TestCase
|
|||
|
||||
$this->assertEquals(2, count(Item::all()));
|
||||
|
||||
$this->delete('/1/EVENT/item/'.$item1->item_uid);
|
||||
$this->delete('/1/EVENT/item/'.$item1->uid);
|
||||
|
||||
$this->assertResponseOk();
|
||||
$this->assertEquals(1, count(Item::all()));
|
||||
|
||||
$item3 = Item::create(['cid'=>$box->cid, 'eid' => $event->eid, 'wann'=>'', 'wo'=>'','description'=>'3']);
|
||||
|
||||
$this->assertEquals(3, $item3['item_uid']);
|
||||
$this->assertEquals(3, $item3['uid']);
|
||||
$this->assertEquals(2, count(Item::all()));
|
||||
|
||||
$this->delete('/1/EVENT/item/'.$item2->item_uid);
|
||||
$this->delete('/1/EVENT/item/'.$item2->uid);
|
||||
|
||||
$this->assertResponseOk();
|
||||
$this->assertEquals(1, count(Item::all()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue