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

[plugin_platform_interface] Test that PlatformInterface and MockPlatformInterfaceMixinTest have no instance methods #4659

Merged
merged 5 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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