/** * {@inheritdoc} */ protected function getUngroupedChoicesArray() { if ($this->getId() === tubepress_wordpress_api_Constants::OPTION_AUTOPOST_CATEGORIES) { $terms = $this->_resourceRepo->getAllCategories(); } else { $terms = $this->_resourceRepo->getAllTags(); } $toReturn = array(); foreach ($terms as $term) { $toReturn[$term->slug] = $term->name; } return $toReturn; }
public function testTags() { $term1 = new stdClass(); $term2 = new stdClass(); $fakeTerms = array($term2, $term1); $this->_mockWpFunctions->shouldReceive('get_tags')->once()->with(array('hide_empty' => false))->andReturn($fakeTerms); $actual = $this->_sut->getAllTags(); $this->assertSame($fakeTerms, $actual); }
public function onWpPostTags(tubepress_api_event_EventInterface $event) { $terms = $this->_resourceRepository->getAllTags(); $this->_handleIncomingTerms($terms, $event, 'tags'); }