lithium\tests\cases\console\command\LibraryTest::testPushNotValid PHP Method

testPushNotValid() public method

public testPushNotValid ( )
    public function testPushNotValid()
    {
        $this->skipIf(!extension_loaded('zlib'), 'The zlib extension is not loaded.');
        $this->skipIf(ini_get('phar.readonly') == '1', 'Skipped test {:class}::{:function}() - INI setting phar.readonly = On');
        $this->library->library = 'library_plugin_test';
        $path = $this->_testPath;
        $expected = true;
        $result = $this->library->extract('plugin', "{$path}/library_test_plugin");
        $this->assertEqual($expected, $result);
        $this->library->response->output = null;
        $file = $this->_testPath . '/library_test_plugin/config/library_test_plugin.json';
        $result = file_put_contents($file, json_encode(array('name' => 'library_test_plugin', 'version' => '1.0', 'summary' => 'something')));
        $this->assertTrue($result);
        $result = $this->library->archive($this->_testPath . '/library_test_plugin', $this->_testPath . '/library_test_plugin');
        $this->assertTrue($result);
        $expected = "library_test_plugin.phar.gz created in {$this->_testPath} from ";
        $expected .= "{$this->_testPath}/library_test_plugin\n";
        $result = $this->library->response->output;
        $this->assertEqual($expected, $result);
        $result = file_exists($this->_testPath . '/library_test_plugin.phar.gz');
        $this->assertTrue($result);
        $this->library->response->output = null;
        $result = $this->library->push('library_test_plugin');
        $this->assertFalse($result);
        $expected = "/The forumla for library_test_plugin is not valid/";
        $result = $this->library->response->error;
        $this->assertPattern($expected, $result);
        $result = is_dir($this->_testPath . '/library_test_plugin');
        $this->assertTrue($result);
        Phar::unlinkArchive($this->_testPath . '/library_test_plugin.phar');
        Phar::unlinkArchive($this->_testPath . '/library_test_plugin.phar.gz');
        $this->_cleanUp();
    }