aboutsummaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/tests
Commit message (Collapse)AuthorAgeFilesLines
* refactor(apps): Use constructor property promotion when possibleprovokateurin2024-10-211-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* chore(apps): Apply new rector configuration to autouse classesCôme Chilliet2024-10-151-1/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #48223 from nextcloud/feat/add-rector-configCôme Chilliet2024-09-231-1/+1
|\ | | | | Add rector config
| * chore: Apply rector configuration to apps folderCôme Chilliet2024-09-201-1/+1
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | fix(activity): Update more activity providers to use new exceptionsfollowup/48086/fix-more-activity-providersJoas Schilling2024-09-231-3/+3
|/ | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-1516-51/+51
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-252-3/+3
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-3116-331/+32
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* chore: Fix twofactor_backupcodes testsCôme Chilliet2024-01-302-24/+12
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(2fa-backupcodes): Don't remember disabled and deleted users over and ↵Joas Schilling2023-11-172-6/+88
| | | | | | over again Signed-off-by: Joas Schilling <coding@schilljs.com>
* Migrate applications away from deprecated ILoggerCôme Chilliet2023-09-211-5/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Allow admins to disable 2FA backup codes via occChristoph Wurst2021-08-242-0/+18
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-0416-32/+35
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix twofactor backup code testsJoas Schilling2021-04-202-4/+3
| | | | | | | | | | 16) OCA\TwoFactorBackupCodes\Tests\Unit\Listener\ActivityPublisherTest::testHandleCodesGeneratedEvent Method publish may not return value of type Mock_IEvent_11bf8381, its return declaration is ": void" 17) OCA\TwoFactorBackupCodes\Tests\Unit\Controller\SettingsControllerTest::testCreateCodes Method getBackupCodesState may not return value of type string, its return declaration is ": array" Signed-off-by: Joas Schilling <coding@schilljs.com>
* Format headerJ0WI2021-04-159-18/+0
| | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* 2FA backupcodes: add strict typingJ0WI2021-04-156-0/+18
| | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-247-0/+7
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use dispatchTyped instead of dispatch on the new event dispatcherMorris Jobke2020-08-181-2/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-126-23/+20
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix risky test in twofactor_backupcodesMorris Jobke2020-07-231-0/+5
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headers for 19Christoph Wurst2020-04-291-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-109-10/+0
| | | | | | | | | | | | | | | 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>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-093-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix (array) indent style to always use one tabChristoph Wurst2020-04-091-4/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-257-29/+29
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-0516-30/+74
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Mode to modern phpunitRoeland Jago Douma2019-11-273-8/+8
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-2715-16/+16
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-221-1/+0
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Only human readbale backup charsRoeland Jago Douma2019-10-221-1/+1
| | | | | | | Fixes #14811 Only use humand readable chars (so no I and 1 etc) Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* use OCP\EventDispatcher\Event over Symfony's deprecated EventArthur Schiwon2019-10-171-6/+0
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Remove leftover unit testRoeland Jago Douma2019-09-141-14/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add icon to twofactor_backupcodes notificationJan-Christoph Borchardt2019-07-161-1/+1
| | | | Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* Add event dispatcher to OCPChristoph Wurst2019-06-256-10/+10
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Do not send notification if no active 2faRoeland Jago Douma2019-03-051-1/+30
| | | | | | | If the job is still present we should also not fire it off if there is not a single active 2FA provider. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Clear backupcodes reminder if no 2FA is enabledRoeland Jago Douma2019-03-051-0/+110
| | | | | | | | | | Fixes #14125 Listen to 2FA disable event. If a provider is disabled for a user. We check if there are no more providers. If there are no more providers we Remove the backupcode reminder notification (if still present). Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add a link to the notification to create the backup codesJoas Schilling2019-02-111-3/+18
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Provide initial stateRoeland Jago Douma2019-01-291-1/+6
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Switch to OCP background jobsRoeland Jago Douma2019-01-141-0/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add job to check users for backup code remindersRoeland Jago Douma2018-10-022-0/+198
| | | | | | | | | Now that we can enforce 2FA we also should notify users that have enabled 2FA but do not yet have backup codes generated. This adds a repair step that inserts a background job to do this. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Clear notification to generate backup code once codes are generatedRoeland Jago Douma2018-10-012-0/+96
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Generate backups code notification if not enable but 2fa isRoeland Jago Douma2018-10-013-0/+380
| | | | | | | | | | | | Generate a notification to generate backup codes if you enable an other 2FA provider but backup codes are not yet generated. * Add event listner * Insert background job * Background job tests and emits notification every 2 weeks * If the backup codes are generated the next run will remove the job Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix integration test execution on DronChristoph Wurst2018-08-212-2/+2
| | | | | | | | | Apparently the Nextcloud server ignores tests that have `Integration` in their fully-qualified class name, hence the backup codes integration tests were removed. This moves them up one directory (out of `Integration`) to fix that. Real unit tests remain in the `Unit` directory. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add an integration test that inserts long back codes valuesChristoph Wurst2018-08-211-0/+9
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix state propragation of the backup codes providerChristoph Wurst2018-08-014-38/+225
| | | | | | | | | | | | Starting with Nextcloud 14, the server knows the enabled/disabled state of 2fa providers. While it will query that information if it's unknown (on first use), it won't notice any changes. Thus, providers have to propagate that information themselves. Ref https://github.com/nextcloud/twofactor_totp/pull/263 Ref https://github.com/nextcloud/twofactor_u2f/pull/210 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix "Undefined method setExpectedException()"Joas Schilling2018-01-241-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix testsJoas Schilling2017-06-201-6/+6
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix backup codes activity typeChristoph Wurst2017-05-181-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Move activities test codeChristoph Wurst2017-05-183-288/+0
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>