Differential D11050 Diff 26707 src/applications/diffusion/remarkup/__tests__/DiffusionCommitRemarkupRuleTestCase.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/remarkup/__tests__/DiffusionCommitRemarkupRuleTestCase.php
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | $cases = array( | ||||
| ), | ), | ||||
| 'ref' => array( | 'ref' => array( | ||||
| array( | array( | ||||
| 'offset' => 1, | 'offset' => 1, | ||||
| 'id' => 'rP1234', | 'id' => 'rP1234', | ||||
| ), | ), | ||||
| ), | ), | ||||
| ), | ), | ||||
| '{rP:1234 key=value}' => array( | |||||
| 'embed' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'rP:1234', | |||||
| 'tail' => ' key=value', | |||||
| ), | |||||
| ), | |||||
| 'ref' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'rP:1234', | |||||
| ), | |||||
| ), | |||||
| ), | |||||
| '{R123:1234 key=value}' => array( | |||||
| 'embed' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'R123:1234', | |||||
| 'tail' => ' key=value', | |||||
| ), | |||||
| ), | |||||
| 'ref' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'R123:1234', | |||||
| ), | |||||
| ), | |||||
| ), | |||||
| '{rP:12f3f6d3a9ef9c7731051815846810cb3c4cd248}' => array( | |||||
| 'embed' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'rP:12f3f6d3a9ef9c7731051815846810cb3c4cd248', | |||||
| ), | |||||
| ), | |||||
| 'ref' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'rP:12f3f6d3a9ef9c7731051815846810cb3c4cd248', | |||||
| ), | |||||
| ), | |||||
| ), | |||||
| '{R123:12f3f6d3a9ef9c7731051815846810cb3c4cd248}' => array( | |||||
| 'embed' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'R123:12f3f6d3a9ef9c7731051815846810cb3c4cd248', | |||||
| ), | |||||
| ), | |||||
| 'ref' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'R123:12f3f6d3a9ef9c7731051815846810cb3c4cd248', | |||||
| ), | |||||
| ), | |||||
| ), | |||||
| '{R123:12f3f6d3a9ef9c7731051815846810cb3c4cd248, key=value}' => array( | |||||
| 'embed' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'R123:12f3f6d3a9ef9c7731051815846810cb3c4cd248', | |||||
| 'tail' => ', key=value', | |||||
| ), | |||||
| ), | |||||
| 'ref' => array( | |||||
| array( | |||||
| 'offset' => 1, | |||||
| 'id' => 'R123:12f3f6d3a9ef9c7731051815846810cb3c4cd248', | |||||
| ), | |||||
| ), | |||||
| ), | |||||
| ); | ); | ||||
| foreach ($cases as $input => $expect) { | foreach ($cases as $input => $expect) { | ||||
| $rule = new DiffusionCommitRemarkupRule(); | $rule = new DiffusionCommitRemarkupRule(); | ||||
| $matches = $rule->extractReferences($input); | $matches = $rule->extractReferences($input); | ||||
| $this->assertEqual($expect, $matches, $input); | $this->assertEqual($expect, $matches, $input); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||