| 1 | <?php |
||
| 10 | class admin_mock_usermanager extends admin_plugin_usermanager { |
||
| 11 | |||
| 12 | public $mock_email_notifications = true; |
||
| 13 | public $mock_email_notifications_sent = 0; |
||
| 14 | |||
| 15 | public function getImportFailures() { |
||
| 16 | return $this->_import_failures; |
||
| 17 | } |
||
| 18 | |||
| 19 | public function tryExport() { |
||
| 20 | ob_start(); |
||
| 21 | $this->_export(); |
||
| 22 | return ob_get_clean(); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function tryImport() { |
||
| 26 | return $this->_import(); |
||
| 27 | } |
||
| 28 | |||
| 29 | // no need to send email notifications (mostly) |
||
| 30 | protected function _notifyUser($user, $password, $status_alert=true) { |
||
| 31 | if ($this->mock_email_notifications) { |
||
| 32 | $this->mock_email_notifications_sent++; |
||
| 33 | return true; |
||
| 34 | } else { |
||
| 35 | return parent::_notifyUser($user, $password, $status_alert); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | protected function _isUploadedFile($file) { |
||
| 40 | return file_exists($file); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 51 |