Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
[plugin_platform_interface] Test that PlatformInterface and `MockPl…
Browse files Browse the repository at this point in the history
…atformInterfaceMixinTest` have no instance methods (#4659)
  • Loading branch information
collinjackson committed Jan 20, 2022
1 parent 3e4483d commit c1bdc81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/plugin_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Adds additional tests for `PlatformInterface` and `MockPlatformInterfaceMixin`.

## 2.1.2

* Updates README to demonstrate `verify` rather than `verifyToken`, and to note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ class ImplementsConstVerifyTokenPluginPlatform extends PlatformInterface
ImplementsConstVerifyTokenPluginPlatform() : super(token: const Object());
}

// Ensures that `PlatformInterface` has no instance methods. Adding an
// instance method is discouraged and may be a breaking change if it
// conflicts with instance methods in subclasses.
class StaticMethodsOnlyPlatformInterfaceTest implements PlatformInterface {}

class StaticMethodsOnlyMockPlatformInterfaceMixinTest
implements MockPlatformInterfaceMixin {}

void main() {
group('`verify`', () {
test('prevents implementation with `implements`', () {
Expand Down

0 comments on commit c1bdc81

Please sign in to comment.