container); $this->assertFalse($pluginDirectory->isCompatible(array('compatible_version' => '1.0.29'), '1.0.28')); $this->assertTrue($pluginDirectory->isCompatible(array('compatible_version' => '1.0.28'), '1.0.28')); $this->assertTrue($pluginDirectory->isCompatible(array('compatible_version' => '1.0.28'), 'master.1234')); } public function testGetAvailablePlugins() { $plugins = array( array( 'title' => 'Plugin A', 'compatible_version' => '1.0.30', 'remote_install' => true, ), array( 'title' => 'Plugin B', 'compatible_version' => '1.0.29', 'remote_install' => false, ), ); $this->container['httpClient'] ->expects($this->once()) ->method('getJson') ->with('api_url') ->will($this->returnValue($plugins)); $pluginDirectory = new Directory($this->container); $availablePlugins = $pluginDirectory->getAvailablePlugins('api_url'); $this->assertCount(1, $availablePlugins); $this->assertEquals('Plugin A', $availablePlugins[0]['title']); } }