pharext\TaskTest::testPecl PHP Method

testPecl() public method

public testPecl ( )
    function testPecl()
    {
        $cmd = new Task\StreamFetch("http://pecl.php.net/get/pecl_http", function ($pct) use(&$log) {
            $log[] = $pct;
        });
        $tmp = $cmd->run();
        $this->assertTrue(is_file($tmp), "is_file({$tmp})");
        $this->assertGreaterThan(1, count($log), "1 < count(\$log)");
        $this->assertContains(0, $log, "in_array(0, \$log)");
        $this->assertContains(1, $log, "in_array(1, \$log)");
        $cmd = new Task\Extract($tmp);
        $dir = $cmd->run();
        $this->assertTrue(is_dir($dir), "is_dir({$dir})");
        $this->assertTrue(is_file("{$dir}/package.xml"), "is_file({$dir}/package.xml");
        $cmd = new Task\PeclFixup($dir);
        $new = $cmd->run();
        $this->assertTrue(is_dir($new), "is_dir({$new})");
        $this->assertFalse(is_file("{$dir}/package.xml"), "is_file({$dir}/package.xml");
        $this->assertTrue(is_file("{$new}/package.xml"), "is_file({$new}/package.xml");
        (new Task\Cleanup($dir))->run();
        $this->assertFalse(is_dir($dir), "is_dir({$dir})");
        $this->assertFalse(is_dir($new), "is_dir({$new})");
    }