public function testGetStates() { // upcoming $states = CourseUtility::getStatesFromState(Offering::STATE_UPCOMING); $this->assertNotEmpty(array_intersect(array('upcoming'), $states), 'Get states should have returned upcoming'); // recent + upcoming $states = CourseUtility::getStatesFromState(Offering::STATE_UPCOMING + Offering::STATE_RECENT); $this->assertNotEmpty(array_intersect(array('upcoming', 'recent'), $states), 'Get states should have returned upcoming and recent'); // recent + just announced + upcoming $states = CourseUtility::getStatesFromState(Offering::STATE_UPCOMING + Offering::STATE_RECENT + Offering::STATE_JUST_ANNOUNCED); $this->assertNotEmpty(array_intersect(array('upcoming', 'recent', 'recentlyAdded'), $states), 'Get states should have returned upcoming, recent, and recentlyAdded'); // self paced $states = CourseUtility::getStatesFromState(Offering::STATE_SELF_PACED); $this->assertNotEmpty(array_intersect(array('selfpaced'), $states), 'Get states should have returned selfpaced'); // ongoing $states = CourseUtility::getStatesFromState(Offering::STATE_IN_PROGRESS); $this->assertNotEmpty(array_intersect(array('ongoing'), $states), 'Get states should have returned ongoing/inprogress'); // finished $states = CourseUtility::getStatesFromState(Offering::STATE_FINISHED); $this->assertNotEmpty(array_intersect(array('past'), $states), 'Get states should have returned finished'); }