Differential D19002 Diff 45600 src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php
<?php | <?php | ||||
/** | /** | ||||
* Mail adapter that doesn't actually send any email, for writing unit tests | * Mail adapter that doesn't actually send any email, for writing unit tests | ||||
* against. | * against. | ||||
*/ | */ | ||||
final class PhabricatorMailImplementationTestAdapter | final class PhabricatorMailImplementationTestAdapter | ||||
extends PhabricatorMailImplementationAdapter { | extends PhabricatorMailImplementationAdapter { | ||||
private $guts = array(); | private $guts = array(); | ||||
private $config; | private $config = array(); | ||||
public function __construct(array $config = array()) { | protected function validateOptions(array $options) { | ||||
PhutilTypeSpec::checkMap( | |||||
$options, | |||||
array()); | |||||
} | |||||
public function newDefaultOptions() { | |||||
return array(); | |||||
} | |||||
public function newLegacyOptions() { | |||||
return array(); | |||||
} | |||||
public function prepareForSend(array $config = array()) { | |||||
$this->config = $config; | $this->config = $config; | ||||
} | } | ||||
public function setFrom($email, $name = '') { | public function setFrom($email, $name = '') { | ||||
$this->guts['from'] = $email; | $this->guts['from'] = $email; | ||||
$this->guts['from-name'] = $name; | $this->guts['from-name'] = $name; | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |