public function pmRequestUnitCase::testRequestParser

8.0.x pmRequestUnitTest.php public pmRequestUnitCase::testRequestParser()
7.x pmRequestUnitTest.php public pmRequestUnitCase::testRequestParser()
master pmRequestUnitTest.php public pmRequestUnitCase::testRequestParser()

Tests for pm_parse_request().

File

tests/pmRequestUnitTest.php, line 250
Tests for pm parsers.

Namespace

Unish

Class

pmRequestUnitCase
pm testing

Code

public function testRequestParser() {
  $request = 'devel-7.x-1.2';
  $request = pm_parse_request($request);
  $this->assertEquals('devel', $request['name']);
  $this->assertEquals('7.x-1.2', $request['version']);

  $request = 'field-conditional-state';
  $request = pm_parse_request($request);
  $this->assertEquals('field-conditional-state', $request['name']);
  $this->assertEquals('', $request['version']);

  $request = 'field-conditional-state-7.x-1.2';
  $request = pm_parse_request($request);
  $this->assertEquals('field-conditional-state', $request['name']);
  $this->assertEquals('7.x-1.2', $request['version']);
}