public function test_delete_badge_criteria() { $criteria_overall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_OVERALL, 'badgeid' => $this->badgeid)); $criteria_overall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL)); $badge = new badge($this->badgeid); $this->assertInstanceOf('award_criteria_overall', $badge->criteria[BADGE_CRITERIA_TYPE_OVERALL]); $badge->criteria[BADGE_CRITERIA_TYPE_OVERALL]->delete(); $this->assertEmpty($badge->get_criteria()); }