public function testContentTypesCanBeAdded() { $types = Content_Type::getAll(); $type_count = count($types); $new_type = new Content_Type('Test Type'); $new_type->save(); $this->assertEquals($type_count, $type_count + 1); }
private function createContentTypeAndTaxonomies($data) { $content_type = new Content_Type($data['name']); $new_taxonomies = array_filter($data['taxonomies'], function ($t) { return $t !== ""; }); foreach ($new_taxonomies as $new_taxonomy) { new Taxonomy($new_taxonomy, $content_type); } if ($content_type->save()) { echo "<div class='wrap'>Saved</div>"; $this->content_types_admin_index(); } else { $this->renderErrors($content_type->errors); } }