Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,19 @@ public function __construct(
* @return array An array of TaxonomyInterface objects.
*/
public function create(string $schemaType): array
{
return [
{
$map = [
'JobPosting' => $this->getJobPostingTaxonomies(),
'Event' => $this->getEventTaxonomies(),
'Project' => $this->getProjectTaxonomies(),
'ExhibitionEvent' => $this->getExhibitionEventTaxonomies(),
'ElementarySchool' => $this->getElementarySchoolTaxonomies(),
'Preschool' => $this->getPreschoolTaxonomies(),
][$schemaType] ?? [];
];

$taxonomies = \apply_filters('Municipio/Schema/Taxonomy/' . $schemaType, $map[$schemaType] ?? [], $schemaType, $this->taxonomyFactory, $this->schemaToPostTypeResolver);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use wpService.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make tests pass.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the mock test signature for the wp service has to be changed since we've added applyFilters. I'm not familiar with your test setup though so out on deep water.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->wpService->applyFilters(


return $taxonomies;
}

/**
Expand Down Expand Up @@ -73,6 +77,7 @@ private function getJobPostingTaxonomies(): array
return [
$this->createTaxonomy('JobPosting', 'relevantOccupation', $this->wpService->__('Job Categories', 'municipio'), $this->wpService->__('Job Category', 'municipio')),
$this->createTaxonomy('JobPosting', 'validThrough', $this->wpService->__('Latest Application Dates', 'municipio'), $this->wpService->__('Latest Application Date', 'municipio')),
$this->createTaxonomy('JobPosting', 'employmentType', $this->wpService->__('Employment Types', 'municipio'), $this->wpService->__('Employment Type', 'municipio')),
];
}

Expand Down
Loading