Differential D13200 Diff 31965 src/applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php
| Show All 28 Lines | $this->assertConfigValid( | ||||
| false, | false, | ||||
| pht('Empty'), | pht('Empty'), | ||||
| array()); | array()); | ||||
| // This is a minimal, valid configuration. | // This is a minimal, valid configuration. | ||||
| $valid = array( | $valid = array( | ||||
| 'open' => array( | 'open' => array( | ||||
| 'name' => 'Open', | 'name' => pht('Open'), | ||||
| 'special' => 'default', | 'special' => 'default', | ||||
| ), | ), | ||||
| 'closed' => array( | 'closed' => array( | ||||
| 'name' => 'Closed', | 'name' => pht('Closed'), | ||||
| 'special' => 'closed', | 'special' => 'closed', | ||||
| 'closed' => true, | 'closed' => true, | ||||
| ), | ), | ||||
| 'duplicate' => array( | 'duplicate' => array( | ||||
| 'name' => 'Duplicate', | 'name' => pht('Duplicate'), | ||||
| 'special' => 'duplicate', | 'special' => 'duplicate', | ||||
| 'closed' => true, | 'closed' => true, | ||||
| ), | ), | ||||
| ); | ); | ||||
| $this->assertConfigValid(true, pht('Minimal Valid Config'), $valid); | $this->assertConfigValid(true, pht('Minimal Valid Config'), $valid); | ||||
| // We should raise on a bad key. | // We should raise on a bad key. | ||||
| $bad_key = $valid; | $bad_key = $valid; | ||||
| $bad_key['!'] = array('name' => 'Exclaim'); | $bad_key['!'] = array('name' => pht('Exclaim')); | ||||
| $this->assertConfigValid(false, pht('Bad Key'), $bad_key); | $this->assertConfigValid(false, pht('Bad Key'), $bad_key); | ||||
| // We should raise on a value type. | // We should raise on a value type. | ||||
| $bad_type = $valid; | $bad_type = $valid; | ||||
| $bad_type['other'] = 'other'; | $bad_type['other'] = 'other'; | ||||
| $this->assertConfigValid(false, pht('Bad Value Type'), $bad_type); | $this->assertConfigValid(false, pht('Bad Value Type'), $bad_type); | ||||
| // We should raise on an unknown configuration key. | // We should raise on an unknown configuration key. | ||||
| $invalid_key = $valid; | $invalid_key = $valid; | ||||
| $invalid_key['open']['imaginary'] = 'unicorn'; | $invalid_key['open']['imaginary'] = 'unicorn'; | ||||
| $this->assertConfigValid(false, pht('Invalid Key'), $invalid_key); | $this->assertConfigValid(false, pht('Invalid Key'), $invalid_key); | ||||
| // We should raise on two statuses with the same special. | // We should raise on two statuses with the same special. | ||||
| $double_close = $valid; | $double_close = $valid; | ||||
| $double_close['finished'] = array( | $double_close['finished'] = array( | ||||
| 'name' => 'Finished', | 'name' => pht('Finished'), | ||||
| 'special' => 'closed', | 'special' => 'closed', | ||||
| 'closed' => true, | 'closed' => true, | ||||
| ); | ); | ||||
| $this->assertConfigValid(false, pht('Duplicate Special'), $double_close); | $this->assertConfigValid(false, pht('Duplicate Special'), $double_close); | ||||
| // We should raise if any of the special statuses are missing. | // We should raise if any of the special statuses are missing. | ||||
| foreach ($valid as $key => $config) { | foreach ($valid as $key => $config) { | ||||
| $missing = $valid; | $missing = $valid; | ||||
| Show All 35 Lines | |||||