<?php

class Wiaas__Package_Type_Test extends Wiaas_Unit_Test_Case {

	/**
	 * @covers Wiaas_Package_Type::register_package_type_taxonomy()
	 * @covers Wiaas_Package_Type::get_available_package_types()
	 */
	function test_register_package_type_taxonomy() {
		$taxonomy = get_taxonomy('package_type');

		$this->assertInstanceOf(WP_Taxonomy::class, $taxonomy);

		$package_types = Wiaas_Package_Type::get_available_package_types();

		$this->assertNotEmpty($package_types);

		$this->assertContains('standard', $package_types);
	}

	/**
	 * @covers Wiaas_Package_Type::set_package_type()
	 * @covers Wiaas_Package_Type::get_package_type()
	 */
	function test_adding_package_type() {
		$package = $this->create_new_package();

		Wiaas_Package_Type::set_package_type($package->get_id(), 'standard');

		$package_type = Wiaas_Package_Type::get_package_type($package->get_id());

		$this->assertNotNull($package_type);
		$this->assertEquals($package_type, 'standard');
	}
}