public function test_convert_name() { $seeker = new Hello_Kushimoto_Speaker_Seeker(); $expected = 'Miyasan'; $actual = $seeker->convert_to_class_name(HELLO_KUSHIMOTO_DIR . '/src/speaker/concrete/class-miyasan.php'); $this->assertEquals($expected, $actual); }
public function test_get_all_speakers() { $speakers = $this->speaker_seeker->get_all_speakers(); $this->assertNotEmpty($speakers); $files = glob(HELLO_KUSHIMOTO_DIR . '/src/speaker/concrete/*.php'); $this->assertEquals(count($files), count($speakers)); }
/** * Hello_Kushimoto constructor. */ public function __construct() { load_plugin_textdomain('hello-kushimoto', false, HELLO_KUSHIMOTO_DOMAIN_PATH); $option_manager = new Hello_Kushimoto_Option_Manager(); $speaker_seeker = new Hello_Kushimoto_Speaker_Seeker($option_manager); new Hello_Kushimoto_Option_Page($option_manager, $speaker_seeker); $speaker = $speaker_seeker->get_current_speaker(); if ($speaker) { $this->speaker = $speaker; $this->initialize_modules(); } }
/** * @return Hello_Kushimoto_Speaker[] */ public function get_speakers() { $classes = $this->speaker_seeker->search_classes(); $speakers = array_map(array($this, 'create_speaker'), $classes); return array_filter($speakers); }