ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ComponentInstaller\Test\Process\ProcessTest Class Reference

Tests Process. More...

+ Inheritance diagram for ComponentInstaller\Test\Process\ProcessTest:
+ Collaboration diagram for ComponentInstaller\Test\Process\ProcessTest:

Public Member Functions

 setUp ()
 
 testGetComponentName ($prettyName, array $extra, $expected)
 testGetComponentName More...
 
 providerGetComponentName ()
 Data provider for testGetComponentName. More...
 

Protected Member Functions

 tearDown ()
 

Protected Attributes

 $composer
 
 $config
 
 $io
 
 $filesystem
 
 $componentDir
 
 $vendorDir
 
 $binDir
 
 $installationManager
 

Detailed Description

Tests Process.

Definition at line 26 of file ProcessTest.php.

Member Function Documentation

◆ providerGetComponentName()

ComponentInstaller\Test\Process\ProcessTest::providerGetComponentName ( )

Data provider for testGetComponentName.

See also
testGetComponentName()

Definition at line 128 of file ProcessTest.php.

129 {
130 return array(
131 array('components/jquery', array(), 'jquery'),
132 array('components/jquery', array('name' => 'myownjquery'), 'myownjquery'),
133 array('jquery', array(), 'jquery'),
134 );
135 }

◆ setUp()

ComponentInstaller\Test\Process\ProcessTest::setUp ( )

Reimplemented in ComponentInstaller\Test\Process\CopyProcessTest, ComponentInstaller\Test\Process\RequireCssProcessTest, and ComponentInstaller\Test\Process\RequireJsProcessTest.

Definition at line 68 of file ProcessTest.php.

69 {
70 $this->filesystem = new Filesystem();
71 $this->composer = new Composer();
72 $this->config = new Config();
73 $this->io = new NullIO();
74
75 $this->componentDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'component-installer-componentDir';
76 $this->vendorDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'component-installer-vendorDir';
77 $this->binDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'component-installer-binDir';
78
79 foreach (array($this->componentDir, $this->vendorDir, $this->binDir) as $dir) {
80 if (is_dir($dir)) {
81 $this->filesystem->removeDirectory($dir);
82 }
83 $this->filesystem->ensureDirectoryExists($dir);
84 }
85 $this->config->merge(array(
86 'config' => array(
87 'vendor-dir' => $this->vendorDir,
88 'component-dir' => $this->componentDir,
89 'bin-dir' => $this->binDir,
90 )
91 ));
92 $this->composer->setConfig($this->config);
93
94 // Set up the Installation Manager.
95 $this->installationManager = new InstallationManager();
96 $this->installationManager->addInstaller(new LibraryInstaller($this->io, $this->composer));
97 $this->installationManager->addInstaller(new Installer($this->io, $this->composer));
98 $this->composer->setInstallationManager($this->installationManager);
99 }

◆ tearDown()

ComponentInstaller\Test\Process\ProcessTest::tearDown ( )
protected

Definition at line 101 of file ProcessTest.php.

102 {
103 foreach (array($this->componentDir, $this->vendorDir, $this->binDir) as $dir) {
104 $this->filesystem->removeDirectory($dir);
105 }
106 }

◆ testGetComponentName()

ComponentInstaller\Test\Process\ProcessTest::testGetComponentName (   $prettyName,
array  $extra,
  $expected 
)

testGetComponentName

@dataProvider providerGetComponentName

Parameters
string$prettyName
array$extra
string$expected

Definition at line 116 of file ProcessTest.php.

117 {
118 $process = new Process($this->composer, $this->io);
119 $result = $process->getComponentName($prettyName, array('component' => $extra));
120 $this->assertEquals($result, $expected, sprintf('Fail to get proper component name for %s', $prettyName));
121 }
sprintf('%.4f', $callTime)
$result

References $result, and sprintf.

Field Documentation

◆ $binDir

ComponentInstaller\Test\Process\ProcessTest::$binDir
protected

Definition at line 61 of file ProcessTest.php.

◆ $componentDir

ComponentInstaller\Test\Process\ProcessTest::$componentDir
protected

Definition at line 51 of file ProcessTest.php.

◆ $composer

ComponentInstaller\Test\Process\ProcessTest::$composer
protected

Definition at line 31 of file ProcessTest.php.

◆ $config

◆ $filesystem

ComponentInstaller\Test\Process\ProcessTest::$filesystem
protected

Definition at line 46 of file ProcessTest.php.

◆ $installationManager

ComponentInstaller\Test\Process\ProcessTest::$installationManager
protected

Definition at line 66 of file ProcessTest.php.

◆ $io

ComponentInstaller\Test\Process\ProcessTest::$io
protected

Definition at line 41 of file ProcessTest.php.

◆ $vendorDir

ComponentInstaller\Test\Process\ProcessTest::$vendorDir
protected

Definition at line 56 of file ProcessTest.php.


The documentation for this class was generated from the following file: