예제 #1
0
 /**
  * Test that we can update a group
  *
  * @since 0.0.7
  *
  * @group crud
  * @group group
  * @group group_crud
  *
  * @covers \ingot\testing\crud\group::update()
  */
 public function testUpdate()
 {
     $params = array('type' => 'click', 'name' => 'bats', 'sub_type' => 'button', 'meta' => ['link' => 'https://bats.com']);
     $created = \ingot\testing\crud\group::create($params);
     $group = \ingot\testing\crud\group::read($created);
     $group['name'] = 'changed';
     \ingot\testing\crud\group::update($group, $created);
     $group = \ingot\testing\crud\group::read($created);
     foreach (\ingot\testing\crud\group::get_required_fields() as $field) {
         $this->assertArrayHasKey($field, $group);
     }
     foreach (\ingot\testing\crud\group::get_needed_fields() as $field) {
         $this->assertArrayHasKey($field, $group);
     }
     $this->assertEquals($group['name'], 'changed');
 }