Commit Graph

23 Commits

Author SHA1 Message Date
Christoph Wurst 883848b58a
Micro-optimize validation of empty email addresses
Then we don't have to construct any validators.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-11 15:15:38 +01:00
Morris Jobke 234b510652
Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-12 13:55:19 +02:00
Roeland Jago Douma bb4dedb015
Provide the proper language to the mailer
Else we can't properly translate the footer in the recipients e-mail
language.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-04-16 09:04:13 +02:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst 41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +02:00
Christoph Wurst 463b388589
Merge pull request #20170 from nextcloud/techdebt/remove-unused-imports
Remove unused imports
2020-03-27 17:14:08 +01:00
Christoph Wurst 2ee65f177e
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:21:27 +01:00
Christoph Wurst 74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:08:08 +01:00
Arne Hamann a16aa99586
Added Hook before Message is send
Signed-off-by: Arne Hamann <kontakt+github@arne.email>
2020-03-24 20:57:27 +01:00
Roeland Jago Douma 3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 15:27:18 +01:00
Roeland Jago Douma c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 13:34:41 +01:00
Branko Kokanovic 7cef9b0248 Addressing comments, array() to []
Signed-off-by: Branko Kokanovic <branko@kokanovic.org>
2018-12-17 23:34:55 +01:00
Branko Kokanovic 72d97b44a7 Expose Swift Mailer streaming options in config, fixes #12702
Signed-off-by: Branko Kokanovic <branko@kokanovic.org>
2018-11-30 22:36:03 +01:00
Daniel Kesselberg 4a2c56b714
Add testcases for pipe mode
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2018-11-29 16:02:37 +01:00
Roeland Jago Douma 054056a8df
Fallback to default path is sendmail can't be found
If the sendmail binary can't be found at all we fallback to the default
path.
It most likely is not there but then at least a proper error message
pops up.

Updated the tests to also properly pass.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-11-02 14:03:11 +01:00
Roeland Jago Douma be7db1573d
Swift to \Swift_Mailer as abstraction
* \Swift_Mailer handles starting the transport etc properly
* Fixed tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-07-04 08:28:33 +02:00
Morris Jobke 9ee1febf62
Provide an option to disable HTML emails
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-04-16 19:00:05 +02:00
Roeland Jago Douma 0c500e460f
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-05 09:06:51 +01:00
Joas Schilling dea011243e
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-09-04 17:01:31 +02:00
Lukas Reschke 3600dd4f52
Add IEMailTemplate to public OCP API
Also adds `\OCP\Mail\IMailer::createEMailTemplate` as helper so the functionality can easily be used within apps.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-04-11 16:35:46 +02:00
Morris Jobke 5b4adf66e5
Move OC_Defaults to OCP\Defaults
* currently there are two ways to access default values:
  OCP\Defaults or OC_Defaults (which is extended by
  OCA\Theming\ThemingDefaults)
* our code used a mixture of both of them, which made
  it hard to work on theme values
* this extended the public interface with the missing
  methods and uses them everywhere to only rely on the
  public interface

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-09 21:43:01 -05:00
Joas Schilling a113f951d6
Adjust the tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-01-20 12:55:48 +01:00
Joas Schilling 94ad54ec9b Move tests/ to PSR-4 (#24731)
* Move a-b to PSR-4

* Move c-d to PSR-4

* Move e+g to PSR-4

* Move h-l to PSR-4

* Move m-r to PSR-4

* Move s-u to PSR-4

* Move files/ to PSR-4

* Move remaining tests to PSR-4

* Remove Test\ from old autoloader
2016-05-20 15:38:20 +02:00