ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
ComponentInstaller\Test\Process\RequireCssProcessTest Class Reference

Tests RequireCssProcess. More...

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

Public Member Functions

 setUp ()
 
 testPackageStyles (array $packages, array $config, $expected=null)
 testPackageStyles More...
 
 providerPackageStyles ()
 
- Public Member Functions inherited from ComponentInstaller\Test\Process\ProcessTest
 setUp ()
 
 testGetComponentName ($prettyName, array $extra, $expected)
 testGetComponentName More...
 
 providerGetComponentName ()
 Data provider for testGetComponentName. More...
 

Protected Attributes

 $process
 
- Protected Attributes inherited from ComponentInstaller\Test\Process\ProcessTest
 $composer
 
 $config
 
 $io
 
 $filesystem
 
 $componentDir
 
 $vendorDir
 
 $binDir
 
 $installationManager
 

Additional Inherited Members

- Protected Member Functions inherited from ComponentInstaller\Test\Process\ProcessTest
 tearDown ()
 

Detailed Description

Tests RequireCssProcess.

Definition at line 20 of file RequireCssProcessTest.php.

Member Function Documentation

◆ providerPackageStyles()

ComponentInstaller\Test\Process\RequireCssProcessTest::providerPackageStyles ( )

Definition at line 48 of file RequireCssProcessTest.php.

References array.

49  {
50  // Test collecting one style.
51  $package = array(
52  'name' => 'components/package',
53  'type' => 'component',
54  'extra' => array(
55  'component' => array(
56  'styles' => array(
57  'tests/ComponentInstaller/Test/Resources/test.css',
58  ),
59  ),
60  ),
61  'is-root' => true,
62  );
63  $packages = array($package);
64  $expected = array(
65  'package' => array(
66  'tests/ComponentInstaller/Test/Resources/test.css' => array(
67  realpath('tests/ComponentInstaller/Test/Resources/test.css'),
68  ),
69  ),
70  );
71  $tests[] = array($packages, array(), $expected);
72 
73  // Test collecting a style that doesn't exist.
74  $package2 = array(
75  'name' => 'components/package2',
76  'type' => 'component',
77  'extra' => array(
78  'component' => array(
79  'styles' => array(
80  'tests/ComponentInstaller/Test/Resources/test-not-found.css',
81  ),
82  ),
83  ),
84  'is-root' => true,
85  );
86  $packages = array($package, $package2);
87  $expected = array(
88  'package' => array(
89  'tests/ComponentInstaller/Test/Resources/test.css' => array(
90  realpath('tests/ComponentInstaller/Test/Resources/test.css'),
91  )
92  )
93  );
94  $tests[] = array($packages, array(), $expected);
95 
96  // Test collecting a style that doesn't exist.
97  $package3 = array(
98  'name' => 'components/package3',
99  'type' => 'component',
100  'extra' => array(
101  'component' => array(
102  'styles' => array(
103  'tests/ComponentInstaller/Test/Resources/test2.css',
104  ),
105  ),
106  ),
107  'is-root' => true,
108  );
109  $packages = array($package, $package3);
110  $expected = array(
111  'package' => array(
112  'tests/ComponentInstaller/Test/Resources/test.css' => array(
113  realpath('tests/ComponentInstaller/Test/Resources/test.css'),
114  ),
115  ),
116  'package3' => array(
117  'tests/ComponentInstaller/Test/Resources/test2.css' => array(
118  realpath('tests/ComponentInstaller/Test/Resources/test2.css'),
119  ),
120  )
121  );
122  $tests[] = array($packages, array(), $expected);
123 
124  // Test collecting a style that uses glob().
125  $package = array(
126  'name' => 'components/package4',
127  'type' => 'component',
128  'extra' => array(
129  'component' => array(
130  'styles' => array(
131  'tests/ComponentInstaller/Test/Resources/*.css',
132  ),
133  ),
134  ),
135  'is-root' => true,
136  );
137  $packages = array($package);
138  $expected = array(
139  'package4' => array(
140  'tests/ComponentInstaller/Test/Resources/*.css' => array(
141  realpath('tests/ComponentInstaller/Test/Resources/test.css'),
142  realpath('tests/ComponentInstaller/Test/Resources/test2.css'),
143  )
144  )
145  );
146  $tests[] = array($packages, array(), $expected);
147 
148  return $tests;
149  }
Create styles array
The data for the language used.

◆ setUp()

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

Definition at line 27 of file RequireCssProcessTest.php.

28  {
29  parent::setUp();
30  $this->process = new RequireCssProcess($this->composer, $this->io);
31  }

◆ testPackageStyles()

ComponentInstaller\Test\Process\RequireCssProcessTest::testPackageStyles ( array  $packages,
array  $config,
  $expected = null 
)

testPackageStyles

providerPackageStyles

Parameters
array$packages
array$config
array$expected

Definition at line 40 of file RequireCssProcessTest.php.

References $result, and array.

41  {
42  $this->composer->getConfig()->merge(array('config' => $config));
43  $this->process->init();
44  $result = $this->process->packageStyles($packages);
45  $this->assertEquals($expected, $result);
46  }
$result
Create styles array
The data for the language used.

Field Documentation

◆ $process

ComponentInstaller\Test\Process\RequireCssProcessTest::$process
protected

Definition at line 25 of file RequireCssProcessTest.php.


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