From a85835e37c69d006163e8ed2230b9ac7bbd7e37e Mon Sep 17 00:00:00 2001 From: Charles Sprayberry Date: Thu, 30 May 2024 22:38:07 -0400 Subject: [PATCH] Start work moving to Amp v3 --- .../BadTestCase.php | 2 +- .../AfterAllNonStaticMethod/BadTestCase.php | 6 +- .../BadTestCase.php | 4 +- .../BadNamespaceTest/MyTestCase.php | 4 +- .../MyTestCase.php | 4 +- .../MyTestCase.php | 4 +- .../MyTestCase.php | 4 +- .../MyTestCase.php | 4 +- .../MyTestSuite.php | 4 +- .../MyTestSuite.php | 4 +- .../MyTestSuite.php | 4 +- .../MyTestSuite.php | 4 +- .../MyTestSuite.php | 4 +- .../MyTestSuite.php | 4 +- .../BadTestCase.php | 4 +- .../BeforeAllNonStaticMethod/BadTestCase.php | 6 +- .../BadTestCase.php | 6 +- .../NoTestsTestCase/BadTestCase.php | 2 +- .../BadTestCase.php | 2 +- .../AfterAllTestSuiteHook/FirstTestCase.php | 8 +- .../AfterAllTestSuiteHook/MyTestSuite.php | 6 +- .../AfterAllTestSuiteHook/SecondTestCase.php | 6 +- .../AfterEachTestSuiteHook/FirstTestCase.php | 10 +- .../AfterEachTestSuiteHook/MyTestSuite.php | 6 +- .../AfterEachTestSuiteHook/SecondTestCase.php | 6 +- .../AfterEachTestSuiteHook/ThirdTestCase.php | 8 +- .../FirstTestCase.php | 10 +- .../MyTestSuite.php | 6 +- .../SecondTestCase.php | 6 +- .../ThirdTestCase.php | 8 +- .../AnnotatedDefaultTestSuite/MyTestCase.php | 8 +- .../AnnotatedDefaultTestSuite/MyTestSuite.php | 4 +- .../BeforeAllTestSuiteHook/FirstTestCase.php | 8 +- .../BeforeAllTestSuiteHook/MyTestSuite.php | 6 +- .../BeforeAllTestSuiteHook/SecondTestCase.php | 6 +- .../BeforeEachTestSuiteHook/FirstTestCase.php | 10 +- .../BeforeEachTestSuiteHook/MyTestSuite.php | 6 +- .../SecondTestCase.php | 6 +- .../BeforeEachTestSuiteHook/ThirdTestCase.php | 8 +- .../FirstTestCase.php | 10 +- .../MyTestSuite.php | 6 +- .../SecondTestCase.php | 6 +- .../ThirdTestCase.php | 8 +- .../FirstTestCase.php | 6 +- .../MyTestSuite.php | 6 +- .../MyTestCase.php | 4 +- .../MyTestSuite.php | 6 +- .../MyTestCase.php | 4 +- .../MyTestSuite.php | 6 +- .../FirstTestCase.php | 6 +- .../MyTestSuite.php | 6 +- .../MyTestCase.php | 4 +- .../MyTestSuite.php | 6 +- .../MyTestCase.php | 4 +- .../MyTestSuite.php | 8 +- .../MyTestCase.php | 10 +- .../MyTestSuite.php | 6 +- .../MyTestCase.php | 10 +- .../MyTestSuite.php | 6 +- .../FirstTestCase.php | 6 +- .../MyTestSuite.php | 2 +- .../SecondTestCase.php | 8 +- .../FirstTestCase.php | 8 +- .../MyFirstTestSuite.php | 2 +- .../MySecondTestSuite.php | 2 +- .../SecondTestCase.php | 8 +- .../ThirdTestCase.php | 8 +- .../HasExplicitTestSuite/MyTestCase.php | 6 +- .../HasImplicitTestSuite/MyTestCase.php | 6 +- .../MyTestCase.php | 6 +- .../MyTestSuite.php | 2 +- .../TestSuiteDisabled/FirstTestCase.php | 6 +- .../TestSuiteDisabled/MyTestSuite.php | 4 +- .../TestSuiteDisabled/SecondTestCase.php | 6 +- .../MyTestCase.php | 6 +- .../MyTestSuite.php | 4 +- .../MyTestCase.php | 6 +- .../MyTestSuite.php | 16 +- .../TestSuiteHasTimeout/FirstTestCase.php | 4 +- .../TestSuiteHasTimeout/MyTestSuite.php | 6 +- .../TestSuiteHasTimeout/SecondTestCase.php | 4 +- .../TestSuiteHookPriority/MyTestCase.php | 8 +- .../TestSuiteHookPriority/MyTestSuite.php | 14 +- .../TestSuiteStateBeforeAll/FirstTestCase.php | 6 +- .../TestSuiteStateBeforeAll/MyTestSuite.php | 6 +- .../CustomAssertions/MyTestCase.php | 7 +- .../ExceptionThrowingAfterAll/MyTestCase.php | 6 +- .../ExceptionThrowingAfterEach/MyTestCase.php | 6 +- .../ExceptionThrowingBeforeAll/MyTestCase.php | 6 +- .../MyTestCase.php | 6 +- .../ExceptionThrowingTest/MyTestCase.php | 4 +- .../MyTestCase.php | 6 +- .../AbstractFourthTestCase.php | 10 +- .../AbstractSecondTestCase.php | 6 +- .../ExtendedTestCases/FifthTestCase.php | 12 +- .../ExtendedTestCases/FirstTestCase.php | 6 +- .../ExtendedTestCases/ThirdTestCase.php | 8 +- .../FailedAssertion/MyTestCase.php | 6 +- .../FailedNotAssertion/MyTestCase.php | 6 +- .../HandleNonPhpFiles/MyTestCase.php | 4 +- .../MyCustomAssertionPlugin.php | 4 +- .../MyOtherCustomAssertionPlugin.php | 6 +- .../HasAssertionPlugin/MyTestCase.php | 6 +- .../HasDataProvider/MyTestCase.php | 8 +- .../HasNotTestCaseObject/MyTestCase.php | 4 +- .../MyResultPrinterPlugin.php | 23 +- .../HasResultPrinterPlugin/MyTestCase.php | 6 +- .../HasSingleAfterAllHook/MyTestCase.php | 6 +- .../HasSingleAfterEachHook/MyTestCase.php | 6 +- .../HasSingleBeforeAllHook/MyTestCase.php | 6 +- .../HasSingleBeforeEachHook/MyTestCase.php | 8 +- .../KitchenSink/FirstTestCase.php | 12 +- .../KitchenSink/FirstTestSuite.php | 2 +- .../SecondBreakfast/BadTestCase.php | 4 +- .../FoodAndBeverageTestCase.php | 8 +- .../KitchenSink/SecondTestCase.php | 13 +- .../KitchenSink/WhatAbout/BilboTestCase.php | 8 +- .../KitchenSink/WhatAbout/FrodoTestCase.php | 8 +- .../KitchenSink/WhatAbout/PotatoTestSuite.php | 4 +- .../KitchenSink/WhatAbout/SamwiseTestCase.php | 8 +- .../MockeryTestNoAssertion/MyTestCase.php | 16 +- .../MultipleBeforeAllHooks/FirstTestCase.php | 8 +- .../MultipleBeforeAllHooks/SecondTestCase.php | 8 +- .../MultipleTest/MyTestCase.php | 10 +- .../MultipleTestCase/BarTestCase.php | 4 +- .../MultipleTestCase/BazTestCase.php | 4 +- .../MultipleTestCase/FooTestCase.php | 4 +- .../FirstTestCase.php | 6 +- .../SecondTestCase.php | 6 +- .../ThirdTestCase.php | 8 +- .../NoAssertions/MyTestCase.php | 4 +- .../RecursiveTestLayout/TestOne.php | 4 +- .../RecursiveTestLayout/Two/TestTwo.php | 4 +- .../Two/Three/Four/Five/TestFive.php | 4 +- .../Two/Three/Four/TestFour.php | 4 +- .../Two/Three/TestThree.php | 4 +- .../SingleMockTest/MyTestCase.php | 8 +- .../SingleTest/MyTestCase.php | 6 +- .../SingleTestAsyncAssertion/MyTestCase.php | 16 - .../SingleTestDisabled/MyTestCase.php | 6 +- .../TestCaseDisabled/MyTestCase.php | 6 +- .../MyTestCase.php | 6 +- .../MyTestCase.php | 14 +- .../TestCaseHasTimeout/MyTestCase.php | 6 +- .../TestCaseHooksPriority/MyTestCase.php | 14 +- .../TestDisabled/MyTestCase.php | 8 +- .../TestDisabledCustomMessage/MyTestCase.php | 6 +- .../TestDisabledEvents/MyTestCase.php | 11 +- .../TestDisabledHookNotInvoked/MyTestCase.php | 12 +- .../MyTestCase.php | 8 +- .../MyTestCase.php | 6 +- .../TestExpectsExceptionOnly/MyTestCase.php | 8 +- .../MyTestCase.php | 6 +- .../MyTestCase.php | 8 +- .../TestExpectsNoAssertions/MyTestCase.php | 4 +- .../MyTestCase.php | 8 +- .../MyTestCase.php | 19 - .../MyTestCase.php | 6 +- .../TestHasOutput/MyTestCase.php | 6 +- .../TestHasTimeout/MyTestCase.php | 8 +- .../TestKnownRunTime/MyTestCase.php | 4 +- .../tests/Bar/FooTestCase.php | 6 +- .../tests/Foo/BarTestCase.php | 6 +- composer.json | 10 +- composer.lock | 119 ++--- .../Assertion/AbstractAsyncAssertion.php | 27 - .../Assertion/AsyncAssertArrayEquals.php | 21 - .../Assertion/AsyncAssertCountEquals.php | 20 - .../Assertion/AsyncAssertFloatEquals.php | 20 - .../Assertion/AsyncAssertInstanceOf.php | 28 -- .../Assertion/AsyncAssertIntEquals.php | 20 - .../Assertion/AsyncAssertIsEmpty.php | 14 - .../Assertion/AsyncAssertIsFalse.php | 13 - framework_src/Assertion/AsyncAssertIsNull.php | 12 - framework_src/Assertion/AsyncAssertIsTrue.php | 12 - .../Assertion/AsyncAssertStringEquals.php | 22 - framework_src/AsyncAssertion.php | 32 -- framework_src/Context/AssertionContext.php | 142 ------ .../Context/AsyncAssertionContext.php | 115 ----- .../Context/LastAssertionCalledTrait.php | 30 -- .../Context/SharedAssertionContextTrait.php | 43 -- .../Event/ProcessingFinishedEvent.php | 21 - .../Event/ProcessingStartedEvent.php | 21 - framework_src/Event/TestCaseFinishedEvent.php | 21 - framework_src/Event/TestCaseStartedEvent.php | 21 - framework_src/Event/TestDisabledEvent.php | 21 - framework_src/Event/TestErroredEvent.php | 19 - framework_src/Event/TestFailedEvent.php | 19 - framework_src/Event/TestPassedEvent.php | 18 - framework_src/Event/TestProcessedEvent.php | 21 - .../Event/TestSuiteFinishedEvent.php | 21 - framework_src/Event/TestSuiteStartedEvent.php | 21 - .../Prototype/AfterEachPrototype.php | 19 - .../Prototype/BeforeEachPrototype.php | 21 - .../Prototype/TestCaseAfterAllPrototype.php | 21 - .../Prototype/TestCaseBeforeAllPrototype.php | 20 - framework_src/Prototype/TestPrototype.php | 19 - framework_src/ResultPrinterPlugin.php | 12 - framework_src/TestCase.php | 84 ---- .../Assertion/AsyncAssertArrayEqualsTest.php | 45 -- .../Assertion/AsyncAssertCountEqualsTest.php | 45 -- .../Assertion/AsyncAssertFloatEqualsTest.php | 50 -- .../Assertion/AsyncAssertInstanceOfTest.php | 51 -- .../Assertion/AsyncAssertIntEqualsTest.php | 45 -- .../Assertion/AsyncAssertIsEmptyTest.php | 49 -- .../Assertion/AsyncAssertIsFalseTest.php | 50 -- .../Assertion/AsyncAssertIsNullTest.php | 45 -- .../Assertion/AsyncAssertIsTrueTest.php | 48 -- .../Assertion/AsyncAssertStringEqualsTest.php | 51 -- .../Context/CustomAssertionContextTest.php | 131 ----- .../MockBridge/MockeryMockBridgeTest.php | 42 -- .../MockBridge/ProphecyMockBridgeTest.php | 56 --- .../dummy_configs/has_mock_bridge.json | 5 - .../Resources/dummy_configs/has_plugins.json | 5 - .../dummy_configs/minimally_valid.json | 5 - framework_test/Stub/AssertNotTestCase.php | 28 -- .../Stub/CustomAssertionTestCase.php | 17 - framework_test/Stub/FailingTestCase.php | 22 - phpunit.xml | 10 +- .../Cli}/TerminalResultPrinter.php | 148 +++--- .../Assertion/AbstractAssertion.php | 6 +- .../Assertion/AssertArrayEquals.php | 6 +- .../Assertion/AssertCountEquals.php | 10 +- .../Assertion/AssertFloatEquals.php | 9 +- .../Framework}/Assertion/AssertInstanceOf.php | 9 +- .../Framework}/Assertion/AssertIntEquals.php | 9 +- .../Framework}/Assertion/AssertIsEmpty.php | 10 +- .../Framework}/Assertion/AssertIsFalse.php | 8 +- .../Framework}/Assertion/AssertIsNull.php | 8 +- .../Framework}/Assertion/AssertIsTrue.php | 8 +- .../Assertion/AssertStringEquals.php | 8 +- .../Framework/Assertion}/Assertion.php | 2 +- .../Framework/Assertion}/AssertionMessage.php | 4 +- .../AssertionMessage/BinaryOperandDetails.php | 4 +- .../AssertionMessage/BinaryOperandSummary.php | 4 +- .../AssertionMessage/CountEqualsMessage.php | 4 +- .../EmptyUnaryOperandDetails.php | 4 +- .../EmptyUnaryOperandSummary.php | 2 +- .../FalseUnaryOperandDetails.php | 2 +- .../FalseUnaryOperandSummary.php | 2 +- .../AssertionMessage/InstanceOfMessage.php | 4 +- .../NullUnaryOperandDetails.php | 2 +- .../NullUnaryOperandSummary.php | 2 +- .../TrueUnaryOperandDetails.php | 2 +- .../TrueUnaryOperandSummary.php | 2 +- .../AssertionMessage/UnaryOperandDetails.php | 4 +- .../AssertionMessage/UnaryOperandSummary.php | 4 +- .../Framework/Assertion}/AssertionResult.php | 2 +- .../Assertion/AssertionResultFactory.php | 5 +- .../Framework}/AsyncUnitApplication.php | 12 +- .../Framework}/AsyncUnitFrameworkRunner.php | 25 +- .../Framework}/Attribute/AfterAll.php | 2 +- .../Framework}/Attribute/AfterEach.php | 2 +- .../Framework}/Attribute/AfterEachTest.php | 2 +- .../Attribute/AttachToTestSuite.php | 4 +- .../Framework}/Attribute/BeforeAll.php | 2 +- .../Framework}/Attribute/BeforeEach.php | 2 +- .../Framework}/Attribute/BeforeEachTest.php | 2 +- .../Framework}/Attribute/DataProvider.php | 4 +- .../Framework}/Attribute/DefaultTestSuite.php | 2 +- .../Framework}/Attribute/Disabled.php | 4 +- .../Framework}/Attribute/Prototype.php | 2 +- .../Attribute/PrototypeRequiresAttribute.php | 4 +- .../Framework}/Attribute/Test.php | 2 +- .../Framework}/Attribute/Timeout.php | 2 +- .../AsyncUnitConfigurationValidator.php | 3 +- .../Configuration/Configuration.php | 2 +- .../Configuration/ConfigurationFactory.php | 2 +- .../ConfigurationValidationResults.php | 2 +- .../Configuration/ConfigurationValidator.php | 2 +- .../JsonConfigurationFactory.php | 10 +- src/Framework/Context/AssertionContext.php | 122 +++++ .../Context/CustomAssertionContext.php | 39 +- .../Framework}/Context/ExpectationContext.php | 21 +- .../Framework}/Context/TestExpector.php | 2 +- .../Framework/Event}/Events.php | 2 +- .../Event/ProcessingFinishedEvent.php | 17 + .../Event/ProcessingStartedEvent.php | 17 + src/Framework/Event/TestCaseFinishedEvent.php | 17 + src/Framework/Event/TestCaseStartedEvent.php | 17 + src/Framework/Event/TestDisabledEvent.php | 16 + src/Framework/Event/TestErroredEvent.php | 17 + src/Framework/Event/TestFailedEvent.php | 17 + src/Framework/Event/TestPassedEvent.php | 16 + src/Framework/Event/TestProcessedEvent.php | 17 + .../Event/TestSuiteFinishedEvent.php | 17 + src/Framework/Event/TestSuiteStartedEvent.php | 17 + .../Exception/AssertionFailedException.php | 14 +- .../Framework}/Exception/Exception.php | 2 +- .../Exception/InvalidArgumentException.php | 2 +- .../InvalidConfigurationException.php | 2 +- .../Exception/InvalidStateException.php | 2 +- .../Exception/MockFailureException.php | 2 +- .../Exception/TestCaseSetUpException.php | 2 +- .../Exception/TestCaseTearDownException.php | 2 +- .../Exception/TestCompilationException.php | 2 +- .../Exception/TestDisabledException.php | 2 +- .../Exception/TestErrorException.php | 2 +- .../Exception/TestFailedException.php | 2 +- .../Exception/TestOutputException.php | 2 +- .../Exception/TestSetupException.php | 2 +- .../Exception/TestSuiteSetUpException.php | 2 +- .../Exception/TestSuiteTearDownException.php | 2 +- .../Exception/TestTearDownException.php | 2 +- .../UnsupportedOperationException.php | 2 +- {framework_src => src/Framework}/HookType.php | 2 +- .../Framework}/ImplicitTestSuite.php | 2 +- .../Framework/MockBridge}/MockBridge.php | 4 +- .../MockBridge}/MockBridgeFactory.php | 2 +- .../MockBridge/MockeryMockBridge.php | 7 +- .../NoConstructorMockBridgeFactory.php | 4 +- .../MockBridge/ProphecyMockBridge.php | 7 +- .../Framework}/Model/CanBeDisabledTrait.php | 2 +- .../Framework}/Model/CanHaveTimeoutTrait.php | 2 +- .../Framework}/Model/HookAware.php | 4 +- .../Framework}/Model/HookModel.php | 6 +- .../Framework}/Model/MethodModelTrait.php | 2 +- .../Framework}/Model/PluginModel.php | 4 +- .../Framework}/Model/TestCaseModel.php | 2 +- .../Framework}/Model/TestModel.php | 2 +- .../Framework}/Model/TestSuiteModel.php | 2 +- .../Parser/AsyncUnitModelCollector.php | 18 +- .../Parser/AsyncUnitModelNodeVisitor.php | 48 +- .../Parser/AttributeGroupTraverser.php | 2 +- .../Framework}/Parser/Parser.php | 2 +- .../Framework}/Parser/ParserResult.php | 16 +- .../Parser/StaticAnalysisParser.php | 8 +- .../Plugin}/CustomAssertionPlugin.php | 6 +- src/Framework/Plugin/ResultPrinterPlugin.php | 12 + .../Prototype/AfterEachPrototype.php | 19 + .../Prototype/BeforeEachPrototype.php | 21 + .../Prototype/DataProviderTestPrototype.php | 12 +- .../Prototype/TestCaseAfterAllPrototype.php | 19 + .../Prototype/TestCaseBeforeAllPrototype.php | 20 + src/Framework/Prototype/TestPrototype.php | 19 + .../Prototype/TestSuiteAfterAllPrototype.php | 10 +- .../Prototype/TestSuiteBeforeAllPrototype.php | 10 +- .../Framework/Randomizer}/NullRandomizer.php | 2 +- .../Framework/Randomizer}/Randomizer.php | 2 +- .../Randomizer}/ShuffleRandomizer.php | 2 +- .../Statistics/AggregateSummary.php | 2 +- .../Statistics/ProcessedAggregateSummary.php | 5 +- .../Statistics/ProcessedSummaryBuilder.php | 42 +- .../Statistics/ProcessedTestCaseSummary.php | 4 +- .../Statistics/ProcessedTestSuiteSummary.php | 4 +- .../Statistics/SummaryCalculator.php | 6 +- .../Framework}/Statistics/TestCaseSummary.php | 2 +- .../Statistics/TestSuiteSummary.php | 2 +- src/Framework/TestCase.php | 53 ++ .../Framework}/TestResult.php | 14 +- .../Framework}/TestState.php | 2 +- .../Framework}/TestSuite.php | 2 +- .../Framework}/TestSuiteRunner.php | 91 ++-- .../Assertion/AbstractAssertionTestCase.php | 4 +- .../AbstractAsyncAssertionTestCase.php | 4 +- .../Assertion/AssertArrayEqualsTest.php | 13 +- .../Assertion/AssertCountEqualsTest.php | 12 +- .../Assertion/AssertFloatEqualsTest.php | 11 +- .../Assertion/AssertInstanceOfTest.php | 16 +- .../Assertion/AssertIntEqualsTest.php | 11 +- .../Assertion/AssertIsEmptyTest.php | 11 +- .../Assertion/AssertIsFalseTest.php | 11 +- .../Framework}/Assertion/AssertIsNullTest.php | 11 +- .../Framework}/Assertion/AssertIsTrueTest.php | 11 +- .../Assertion/AssertStringEqualsTest.php | 11 +- .../BinaryOperandDetailsTest.php | 3 +- .../BinaryOperandSummaryTest.php | 3 +- .../CountEqualsMessageTest.php | 5 +- .../EmptyUnaryOperandDetailsTest.php | 3 +- .../EmptyUnaryOperandSummaryTest.php | 3 +- .../FalseUnaryOperandDetailsTest.php | 3 +- .../FalseUnaryOperandTest.php | 3 +- .../InstanceOfSummaryTest.php | 5 +- .../NullUnaryOperandDetailsTest.php | 3 +- .../AssertionMessage/NullUnaryOperandTest.php | 3 +- .../TrueUnaryOperandDetailsTest.php | 3 +- .../AssertionMessage/TrueUnaryOperandTest.php | 3 +- .../Framework}/AsyncUnitApplicationTest.php | 85 ++-- .../Unit/Framework}/AsyncUnitAssertions.php | 10 +- .../AsyncUnitConfigurationValidatorTest.php | 12 +- .../AsyncUnitFrameworkRunnerTest.php | 23 +- .../Constraint/TestCaseModelHasTestMethod.php | 6 +- .../TestCaseModelHasTestMethodTest.php | 8 +- .../TestSuiteModelHasTestCaseModel.php | 10 +- .../TestSuiteModelHasTestCaseModelTest.php | 10 +- .../Context/CustomAssertionContextTest.php | 75 +++ .../JsonConfigurationFactoryTest.php | 10 +- .../MockBridge/MockeryMockBridgeTest.php | 42 ++ .../MockBridge/ProphecyMockBridgeTest.php | 54 ++ .../Resources/dummy_configs/bad_keys.json | 0 .../Resources/dummy_configs/empty_object.json | 0 .../dummy_configs/good_keys_bad_types.json | 0 .../dummy_configs/good_keys_but_extra.json | 0 .../dummy_configs/has_mock_bridge.json | 5 + .../Resources/dummy_configs/has_plugins.json | 5 + .../dummy_configs/minimally_valid.json | 5 + .../mock_bridge_empty_string.json | 0 .../dummy_configs/plugins_empty.json | 0 .../dummy_configs/plugins_empty_string.json | 0 .../dummy_configs/plugins_non_string.json | 0 .../dummy_configs/result_printer_empty.json | 0 .../dummy_configs/result_printer_null.json | 0 .../dummy_configs/test_dirs_empty.json | 0 .../dummy_configs/test_dirs_empty_string.json | 0 .../dummy_configs/test_dirs_non_string.json | 0 .../Unit/Framework}/ShuffleRandomizerTest.php | 3 +- .../Framework}/StaticAnalysisParserTest.php | 24 +- .../Statistics/SummaryCalculatorTest.php | 9 +- .../Unit/Framework/Stub/AssertNotTestCase.php | 24 + .../Framework}/Stub/BarAssertionPlugin.php | 6 +- .../Unit/Framework}/Stub/CountableStub.php | 2 +- .../Stub/CustomAssertionTestCase.php | 14 + .../Stub/FailingMockBridgeFactory.php | 6 +- .../Framework}/Stub/FailingMockBridgeStub.php | 7 +- tests/Unit/Framework/Stub/FailingTestCase.php | 18 + .../Framework}/Stub/FooAssertionPlugin.php | 6 +- .../Framework}/Stub/MockAwareTestCase.php | 8 +- .../Unit/Framework}/Stub/MockBridgeStub.php | 4 +- .../Framework}/Stub/TestConfiguration.php | 7 +- .../Unit/Framework}/TestCaseTest.php | 113 +---- .../Unit/Framework}/TestSuiteErrorsTest.php | 16 +- .../Framework}/TestSuiteRunnerScaffolding.php | 22 +- .../TestSuiteRunnerStatisticsTest.php | 465 +++++++----------- .../Unit/Framework}/TestSuiteRunnerTest.php | 146 +++--- .../Unit/Framework}/UsesAcmeSrc.php | 4 +- 425 files changed, 2173 insertions(+), 3590 deletions(-) delete mode 100644 acme_src/ImplicitDefaultTestSuite/SingleTestAsyncAssertion/MyTestCase.php delete mode 100644 acme_src/ImplicitDefaultTestSuite/TestExpectsNoAsyncAssertionsAssertMade/MyTestCase.php delete mode 100644 framework_src/Assertion/AbstractAsyncAssertion.php delete mode 100644 framework_src/Assertion/AsyncAssertArrayEquals.php delete mode 100644 framework_src/Assertion/AsyncAssertCountEquals.php delete mode 100644 framework_src/Assertion/AsyncAssertFloatEquals.php delete mode 100644 framework_src/Assertion/AsyncAssertInstanceOf.php delete mode 100644 framework_src/Assertion/AsyncAssertIntEquals.php delete mode 100644 framework_src/Assertion/AsyncAssertIsEmpty.php delete mode 100644 framework_src/Assertion/AsyncAssertIsFalse.php delete mode 100644 framework_src/Assertion/AsyncAssertIsNull.php delete mode 100644 framework_src/Assertion/AsyncAssertIsTrue.php delete mode 100644 framework_src/Assertion/AsyncAssertStringEquals.php delete mode 100644 framework_src/AsyncAssertion.php delete mode 100644 framework_src/Context/AssertionContext.php delete mode 100644 framework_src/Context/AsyncAssertionContext.php delete mode 100644 framework_src/Context/LastAssertionCalledTrait.php delete mode 100644 framework_src/Context/SharedAssertionContextTrait.php delete mode 100644 framework_src/Event/ProcessingFinishedEvent.php delete mode 100644 framework_src/Event/ProcessingStartedEvent.php delete mode 100644 framework_src/Event/TestCaseFinishedEvent.php delete mode 100644 framework_src/Event/TestCaseStartedEvent.php delete mode 100644 framework_src/Event/TestDisabledEvent.php delete mode 100644 framework_src/Event/TestErroredEvent.php delete mode 100644 framework_src/Event/TestFailedEvent.php delete mode 100644 framework_src/Event/TestPassedEvent.php delete mode 100644 framework_src/Event/TestProcessedEvent.php delete mode 100644 framework_src/Event/TestSuiteFinishedEvent.php delete mode 100644 framework_src/Event/TestSuiteStartedEvent.php delete mode 100644 framework_src/Prototype/AfterEachPrototype.php delete mode 100644 framework_src/Prototype/BeforeEachPrototype.php delete mode 100644 framework_src/Prototype/TestCaseAfterAllPrototype.php delete mode 100644 framework_src/Prototype/TestCaseBeforeAllPrototype.php delete mode 100644 framework_src/Prototype/TestPrototype.php delete mode 100644 framework_src/ResultPrinterPlugin.php delete mode 100644 framework_src/TestCase.php delete mode 100644 framework_test/Assertion/AsyncAssertArrayEqualsTest.php delete mode 100644 framework_test/Assertion/AsyncAssertCountEqualsTest.php delete mode 100644 framework_test/Assertion/AsyncAssertFloatEqualsTest.php delete mode 100644 framework_test/Assertion/AsyncAssertInstanceOfTest.php delete mode 100644 framework_test/Assertion/AsyncAssertIntEqualsTest.php delete mode 100644 framework_test/Assertion/AsyncAssertIsEmptyTest.php delete mode 100644 framework_test/Assertion/AsyncAssertIsFalseTest.php delete mode 100644 framework_test/Assertion/AsyncAssertIsNullTest.php delete mode 100644 framework_test/Assertion/AsyncAssertIsTrueTest.php delete mode 100644 framework_test/Assertion/AsyncAssertStringEqualsTest.php delete mode 100644 framework_test/Context/CustomAssertionContextTest.php delete mode 100644 framework_test/MockBridge/MockeryMockBridgeTest.php delete mode 100644 framework_test/MockBridge/ProphecyMockBridgeTest.php delete mode 100644 framework_test/Resources/dummy_configs/has_mock_bridge.json delete mode 100644 framework_test/Resources/dummy_configs/has_plugins.json delete mode 100644 framework_test/Resources/dummy_configs/minimally_valid.json delete mode 100644 framework_test/Stub/AssertNotTestCase.php delete mode 100644 framework_test/Stub/CustomAssertionTestCase.php delete mode 100644 framework_test/Stub/FailingTestCase.php rename {cli_src => src/Cli}/TerminalResultPrinter.php (56%) rename {framework_src => src/Framework}/Assertion/AbstractAssertion.php (79%) rename {framework_src => src/Framework}/Assertion/AssertArrayEquals.php (65%) rename {framework_src => src/Framework}/Assertion/AssertCountEquals.php (61%) rename {framework_src => src/Framework}/Assertion/AssertFloatEquals.php (55%) rename {framework_src => src/Framework}/Assertion/AssertInstanceOf.php (75%) rename {framework_src => src/Framework}/Assertion/AssertIntEquals.php (55%) rename {framework_src => src/Framework}/Assertion/AssertIsEmpty.php (51%) rename {framework_src => src/Framework}/Assertion/AssertIsFalse.php (60%) rename {framework_src => src/Framework}/Assertion/AssertIsNull.php (60%) rename {framework_src => src/Framework}/Assertion/AssertIsTrue.php (60%) rename {framework_src => src/Framework}/Assertion/AssertStringEquals.php (58%) rename {framework_src => src/Framework/Assertion}/Assertion.php (96%) rename {framework_src => src/Framework/Assertion}/AssertionMessage.php (86%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/BinaryOperandDetails.php (83%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/BinaryOperandSummary.php (83%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/CountEqualsMessage.php (86%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/EmptyUnaryOperandDetails.php (63%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/EmptyUnaryOperandSummary.php (73%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/FalseUnaryOperandDetails.php (73%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/FalseUnaryOperandSummary.php (73%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/InstanceOfMessage.php (85%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/NullUnaryOperandDetails.php (73%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/NullUnaryOperandSummary.php (73%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/TrueUnaryOperandDetails.php (73%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/TrueUnaryOperandSummary.php (73%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/UnaryOperandDetails.php (87%) rename {framework_src => src/Framework}/Assertion/AssertionMessage/UnaryOperandSummary.php (81%) rename {framework_src => src/Framework/Assertion}/AssertionResult.php (95%) rename {framework_src => src/Framework}/Assertion/AssertionResultFactory.php (91%) rename {framework_src => src/Framework}/AsyncUnitApplication.php (86%) rename {framework_src => src/Framework}/AsyncUnitFrameworkRunner.php (66%) rename {framework_src => src/Framework}/Attribute/AfterAll.php (75%) rename {framework_src => src/Framework}/Attribute/AfterEach.php (75%) rename {framework_src => src/Framework}/Attribute/AfterEachTest.php (75%) rename {framework_src => src/Framework}/Attribute/AttachToTestSuite.php (70%) rename {framework_src => src/Framework}/Attribute/BeforeAll.php (78%) rename {framework_src => src/Framework}/Attribute/BeforeEach.php (78%) rename {framework_src => src/Framework}/Attribute/BeforeEachTest.php (75%) rename {framework_src => src/Framework}/Attribute/DataProvider.php (69%) rename {framework_src => src/Framework}/Attribute/DefaultTestSuite.php (70%) rename {framework_src => src/Framework}/Attribute/Disabled.php (68%) rename {framework_src => src/Framework}/Attribute/Prototype.php (85%) rename {framework_src => src/Framework}/Attribute/PrototypeRequiresAttribute.php (75%) rename {framework_src => src/Framework}/Attribute/Test.php (68%) rename {framework_src => src/Framework}/Attribute/Timeout.php (80%) rename {framework_src => src/Framework}/Configuration/AsyncUnitConfigurationValidator.php (95%) rename {framework_src => src/Framework}/Configuration/Configuration.php (88%) rename {framework_src => src/Framework}/Configuration/ConfigurationFactory.php (70%) rename {framework_src => src/Framework}/Configuration/ConfigurationValidationResults.php (87%) rename {framework_src => src/Framework}/Configuration/ConfigurationValidator.php (75%) rename {framework_src => src/Framework/Configuration}/JsonConfigurationFactory.php (86%) create mode 100644 src/Framework/Context/AssertionContext.php rename {framework_src => src/Framework}/Context/CustomAssertionContext.php (53%) rename {framework_src => src/Framework}/Context/ExpectationContext.php (89%) rename {framework_src => src/Framework}/Context/TestExpector.php (82%) rename {framework_src => src/Framework/Event}/Events.php (94%) create mode 100644 src/Framework/Event/ProcessingFinishedEvent.php create mode 100644 src/Framework/Event/ProcessingStartedEvent.php create mode 100644 src/Framework/Event/TestCaseFinishedEvent.php create mode 100644 src/Framework/Event/TestCaseStartedEvent.php create mode 100644 src/Framework/Event/TestDisabledEvent.php create mode 100644 src/Framework/Event/TestErroredEvent.php create mode 100644 src/Framework/Event/TestFailedEvent.php create mode 100644 src/Framework/Event/TestPassedEvent.php create mode 100644 src/Framework/Event/TestProcessedEvent.php create mode 100644 src/Framework/Event/TestSuiteFinishedEvent.php create mode 100644 src/Framework/Event/TestSuiteStartedEvent.php rename {framework_src => src/Framework}/Exception/AssertionFailedException.php (50%) rename {framework_src => src/Framework}/Exception/Exception.php (66%) rename {framework_src => src/Framework}/Exception/InvalidArgumentException.php (63%) rename {framework_src => src/Framework}/Exception/InvalidConfigurationException.php (64%) rename {framework_src => src/Framework}/Exception/InvalidStateException.php (62%) rename {framework_src => src/Framework}/Exception/MockFailureException.php (64%) rename {framework_src => src/Framework}/Exception/TestCaseSetUpException.php (62%) rename {framework_src => src/Framework}/Exception/TestCaseTearDownException.php (63%) rename {framework_src => src/Framework}/Exception/TestCompilationException.php (63%) rename {framework_src => src/Framework}/Exception/TestDisabledException.php (78%) rename {framework_src => src/Framework}/Exception/TestErrorException.php (61%) rename {framework_src => src/Framework}/Exception/TestFailedException.php (61%) rename {framework_src => src/Framework}/Exception/TestOutputException.php (65%) rename {framework_src => src/Framework}/Exception/TestSetupException.php (61%) rename {framework_src => src/Framework}/Exception/TestSuiteSetUpException.php (62%) rename {framework_src => src/Framework}/Exception/TestSuiteTearDownException.php (63%) rename {framework_src => src/Framework}/Exception/TestTearDownException.php (62%) rename {framework_src => src/Framework}/Exception/UnsupportedOperationException.php (64%) rename {framework_src => src/Framework}/HookType.php (87%) rename {framework_src => src/Framework}/ImplicitTestSuite.php (67%) rename {framework_src => src/Framework/MockBridge}/MockBridge.php (92%) rename {framework_src => src/Framework/MockBridge}/MockBridgeFactory.php (71%) rename {framework_src => src/Framework}/MockBridge/MockeryMockBridge.php (86%) rename {framework_src => src/Framework/MockBridge}/NoConstructorMockBridgeFactory.php (75%) rename {framework_src => src/Framework}/MockBridge/ProphecyMockBridge.php (82%) rename {framework_src => src/Framework}/Model/CanBeDisabledTrait.php (91%) rename {framework_src => src/Framework}/Model/CanHaveTimeoutTrait.php (85%) rename {framework_src => src/Framework}/Model/HookAware.php (85%) rename {framework_src => src/Framework}/Model/HookModel.php (88%) rename {framework_src => src/Framework}/Model/MethodModelTrait.php (87%) rename {framework_src => src/Framework}/Model/PluginModel.php (79%) rename {framework_src => src/Framework}/Model/TestCaseModel.php (95%) rename {framework_src => src/Framework}/Model/TestModel.php (92%) rename {framework_src => src/Framework}/Model/TestSuiteModel.php (94%) rename {framework_src => src/Framework}/Parser/AsyncUnitModelCollector.php (92%) rename {framework_src => src/Framework}/Parser/AsyncUnitModelNodeVisitor.php (91%) rename {framework_src => src/Framework}/Parser/AttributeGroupTraverser.php (92%) rename {framework_src => src/Framework}/Parser/Parser.php (81%) rename {framework_src => src/Framework}/Parser/ParserResult.php (75%) rename {framework_src => src/Framework}/Parser/StaticAnalysisParser.php (93%) rename {framework_src => src/Framework/Plugin}/CustomAssertionPlugin.php (58%) create mode 100644 src/Framework/Plugin/ResultPrinterPlugin.php create mode 100644 src/Framework/Prototype/AfterEachPrototype.php create mode 100644 src/Framework/Prototype/BeforeEachPrototype.php rename {framework_src => src/Framework}/Prototype/DataProviderTestPrototype.php (50%) create mode 100644 src/Framework/Prototype/TestCaseAfterAllPrototype.php create mode 100644 src/Framework/Prototype/TestCaseBeforeAllPrototype.php create mode 100644 src/Framework/Prototype/TestPrototype.php rename {framework_src => src/Framework}/Prototype/TestSuiteAfterAllPrototype.php (50%) rename {framework_src => src/Framework}/Prototype/TestSuiteBeforeAllPrototype.php (50%) rename {framework_src => src/Framework/Randomizer}/NullRandomizer.php (76%) rename {framework_src => src/Framework/Randomizer}/Randomizer.php (68%) rename {framework_src => src/Framework/Randomizer}/ShuffleRandomizer.php (79%) rename {framework_src => src/Framework}/Statistics/AggregateSummary.php (89%) rename {framework_src => src/Framework}/Statistics/ProcessedAggregateSummary.php (88%) rename {framework_src => src/Framework}/Statistics/ProcessedSummaryBuilder.php (90%) rename {framework_src => src/Framework}/Statistics/ProcessedTestCaseSummary.php (85%) rename {framework_src => src/Framework}/Statistics/ProcessedTestSuiteSummary.php (86%) rename {framework_src => src/Framework}/Statistics/SummaryCalculator.php (97%) rename {framework_src => src/Framework}/Statistics/TestCaseSummary.php (85%) rename {framework_src => src/Framework}/Statistics/TestSuiteSummary.php (87%) create mode 100644 src/Framework/TestCase.php rename {framework_src => src/Framework}/TestResult.php (66%) rename {framework_src => src/Framework}/TestState.php (81%) rename {framework_src => src/Framework}/TestSuite.php (92%) rename {framework_src => src/Framework}/TestSuiteRunner.php (84%) rename {framework_test => tests/Unit/Framework}/Assertion/AbstractAssertionTestCase.php (93%) rename {framework_test => tests/Unit/Framework}/Assertion/AbstractAsyncAssertionTestCase.php (95%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertArrayEqualsTest.php (66%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertCountEqualsTest.php (67%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertFloatEqualsTest.php (65%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertInstanceOfTest.php (78%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertIntEqualsTest.php (65%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertIsEmptyTest.php (62%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertIsFalseTest.php (63%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertIsNullTest.php (62%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertIsTrueTest.php (63%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertStringEqualsTest.php (65%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/BinaryOperandDetailsTest.php (88%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/BinaryOperandSummaryTest.php (87%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/CountEqualsMessageTest.php (84%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/EmptyUnaryOperandDetailsTest.php (88%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/EmptyUnaryOperandSummaryTest.php (87%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/FalseUnaryOperandDetailsTest.php (88%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/FalseUnaryOperandTest.php (87%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/InstanceOfSummaryTest.php (88%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/NullUnaryOperandDetailsTest.php (88%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/NullUnaryOperandTest.php (87%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/TrueUnaryOperandDetailsTest.php (88%) rename {framework_test => tests/Unit/Framework}/Assertion/AssertionMessage/TrueUnaryOperandTest.php (87%) rename {framework_test => tests/Unit/Framework}/AsyncUnitApplicationTest.php (76%) rename {framework_test => tests/Unit/Framework}/AsyncUnitAssertions.php (64%) rename {framework_test => tests/Unit/Framework}/AsyncUnitConfigurationValidatorTest.php (88%) rename {framework_test => tests/Unit/Framework}/AsyncUnitFrameworkRunnerTest.php (80%) rename {framework_test => tests/Unit/Framework}/Constraint/TestCaseModelHasTestMethod.php (83%) rename {framework_test => tests/Unit/Framework}/Constraint/TestCaseModelHasTestMethodTest.php (89%) rename {framework_test => tests/Unit/Framework}/Constraint/TestSuiteModelHasTestCaseModel.php (69%) rename {framework_test => tests/Unit/Framework}/Constraint/TestSuiteModelHasTestCaseModelTest.php (85%) create mode 100644 tests/Unit/Framework/Context/CustomAssertionContextTest.php rename {framework_test => tests/Unit/Framework}/JsonConfigurationFactoryTest.php (91%) create mode 100644 tests/Unit/Framework/MockBridge/MockeryMockBridgeTest.php create mode 100644 tests/Unit/Framework/MockBridge/ProphecyMockBridgeTest.php rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/bad_keys.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/empty_object.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/good_keys_bad_types.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/good_keys_but_extra.json (100%) create mode 100644 tests/Unit/Framework/Resources/dummy_configs/has_mock_bridge.json create mode 100644 tests/Unit/Framework/Resources/dummy_configs/has_plugins.json create mode 100644 tests/Unit/Framework/Resources/dummy_configs/minimally_valid.json rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/mock_bridge_empty_string.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/plugins_empty.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/plugins_empty_string.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/plugins_non_string.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/result_printer_empty.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/result_printer_null.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/test_dirs_empty.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/test_dirs_empty_string.json (100%) rename {framework_test => tests/Unit/Framework}/Resources/dummy_configs/test_dirs_non_string.json (100%) rename {framework_test => tests/Unit/Framework}/ShuffleRandomizerTest.php (79%) rename {framework_test => tests/Unit/Framework}/StaticAnalysisParserTest.php (97%) rename {framework_test => tests/Unit/Framework}/Statistics/SummaryCalculatorTest.php (98%) create mode 100644 tests/Unit/Framework/Stub/AssertNotTestCase.php rename {framework_test => tests/Unit/Framework}/Stub/BarAssertionPlugin.php (71%) rename {framework_test => tests/Unit/Framework}/Stub/CountableStub.php (82%) create mode 100644 tests/Unit/Framework/Stub/CustomAssertionTestCase.php rename {framework_test => tests/Unit/Framework}/Stub/FailingMockBridgeFactory.php (55%) rename {framework_test => tests/Unit/Framework}/Stub/FailingMockBridgeStub.php (72%) create mode 100644 tests/Unit/Framework/Stub/FailingTestCase.php rename {framework_test => tests/Unit/Framework}/Stub/FooAssertionPlugin.php (71%) rename {framework_test => tests/Unit/Framework}/Stub/MockAwareTestCase.php (65%) rename {framework_test => tests/Unit/Framework}/Stub/MockBridgeStub.php (85%) rename {framework_test => tests/Unit/Framework}/Stub/TestConfiguration.php (87%) rename {framework_test => tests/Unit/Framework}/TestCaseTest.php (52%) rename {framework_test => tests/Unit/Framework}/TestSuiteErrorsTest.php (93%) rename {framework_test => tests/Unit/Framework}/TestSuiteRunnerScaffolding.php (58%) rename {framework_test => tests/Unit/Framework}/TestSuiteRunnerStatisticsTest.php (69%) rename {framework_test => tests/Unit/Framework}/TestSuiteRunnerTest.php (88%) rename {framework_test => tests/Unit/Framework}/UsesAcmeSrc.php (78%) diff --git a/acme_src/ErrorConditions/AfterAllAttributeOnNotTestCaseOrTestSuite/BadTestCase.php b/acme_src/ErrorConditions/AfterAllAttributeOnNotTestCaseOrTestSuite/BadTestCase.php index 6618506..81c8c86 100644 --- a/acme_src/ErrorConditions/AfterAllAttributeOnNotTestCaseOrTestSuite/BadTestCase.php +++ b/acme_src/ErrorConditions/AfterAllAttributeOnNotTestCaseOrTestSuite/BadTestCase.php @@ -2,7 +2,7 @@ namespace Acme\DemoSuites\ErrorConditions\AfterAllAttributeOnNotTestCaseOrTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; class BadTestCase { diff --git a/acme_src/ErrorConditions/AfterAllNonStaticMethod/BadTestCase.php b/acme_src/ErrorConditions/AfterAllNonStaticMethod/BadTestCase.php index 878428c..0b32a49 100644 --- a/acme_src/ErrorConditions/AfterAllNonStaticMethod/BadTestCase.php +++ b/acme_src/ErrorConditions/AfterAllNonStaticMethod/BadTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ErrorConditions\AfterAllNonStaticMethod; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class BadTestCase extends TestCase { diff --git a/acme_src/ErrorConditions/AfterEachAttributeOnNotTestCaseOrTestSuite/BadTestCase.php b/acme_src/ErrorConditions/AfterEachAttributeOnNotTestCaseOrTestSuite/BadTestCase.php index 5da7956..86235ef 100644 --- a/acme_src/ErrorConditions/AfterEachAttributeOnNotTestCaseOrTestSuite/BadTestCase.php +++ b/acme_src/ErrorConditions/AfterEachAttributeOnNotTestCaseOrTestSuite/BadTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\AfterEachAttributeOnNotTestCaseOrTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; class BadTestCase { diff --git a/acme_src/ErrorConditions/BadNamespaceTest/MyTestCase.php b/acme_src/ErrorConditions/BadNamespaceTest/MyTestCase.php index efd7e75..dd75e1a 100644 --- a/acme_src/ErrorConditions/BadNamespaceTest/MyTestCase.php +++ b/acme_src/ErrorConditions/BadNamespaceTest/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTest\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ErrorConditions/BadNamespaceTestCaseAfterAll/MyTestCase.php b/acme_src/ErrorConditions/BadNamespaceTestCaseAfterAll/MyTestCase.php index 4c8648d..d645762 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestCaseAfterAll/MyTestCase.php +++ b/acme_src/ErrorConditions/BadNamespaceTestCaseAfterAll/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestCaseAfterAll\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ErrorConditions/BadNamespaceTestCaseAfterEach/MyTestCase.php b/acme_src/ErrorConditions/BadNamespaceTestCaseAfterEach/MyTestCase.php index 4d4f74a..56c4e4e 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestCaseAfterEach/MyTestCase.php +++ b/acme_src/ErrorConditions/BadNamespaceTestCaseAfterEach/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestCaseAfterEach\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ErrorConditions/BadNamespaceTestCaseBeforeAll/MyTestCase.php b/acme_src/ErrorConditions/BadNamespaceTestCaseBeforeAll/MyTestCase.php index 9cf63f4..df998af 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestCaseBeforeAll/MyTestCase.php +++ b/acme_src/ErrorConditions/BadNamespaceTestCaseBeforeAll/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestCaseBeforeAll\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ErrorConditions/BadNamespaceTestCaseBeforeEach/MyTestCase.php b/acme_src/ErrorConditions/BadNamespaceTestCaseBeforeEach/MyTestCase.php index b9b7186..5b23bc0 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestCaseBeforeEach/MyTestCase.php +++ b/acme_src/ErrorConditions/BadNamespaceTestCaseBeforeEach/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestCaseBeforeEach\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterAll/MyTestSuite.php b/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterAll/MyTestSuite.php index 80a9cc1..e7b3faf 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterAll/MyTestSuite.php +++ b/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterAll/MyTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteAfterAll\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestSuite extends TestSuite { diff --git a/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterEach/MyTestSuite.php b/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterEach/MyTestSuite.php index 1a77d66..d4b5929 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterEach/MyTestSuite.php +++ b/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterEach/MyTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteAfterEach\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestSuite extends TestSuite { diff --git a/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterEachTest/MyTestSuite.php b/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterEachTest/MyTestSuite.php index 29246e1..9172705 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterEachTest/MyTestSuite.php +++ b/acme_src/ErrorConditions/BadNamespaceTestSuiteAfterEachTest/MyTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteAfterEachTest\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEachTest; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterEachTest; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestSuite extends TestSuite { diff --git a/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeAll/MyTestSuite.php b/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeAll/MyTestSuite.php index 1319935..781cb34 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeAll/MyTestSuite.php +++ b/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeAll/MyTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteBeforeAll\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestSuite extends TestSuite { diff --git a/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeEach/MyTestSuite.php b/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeEach/MyTestSuite.php index 9c05424..06b4eaf 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeEach/MyTestSuite.php +++ b/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeEach/MyTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteBeforeEach\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestSuite extends TestSuite { diff --git a/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeEachTest/MyTestSuite.php b/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeEachTest/MyTestSuite.php index 38cd95d..3aa9deb 100644 --- a/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeEachTest/MyTestSuite.php +++ b/acme_src/ErrorConditions/BadNamespaceTestSuiteBeforeEachTest/MyTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BadNamespaceTestSuiteBeforeEachTest\IntentionallyBad; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEachTest; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEachTest; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestSuite extends TestSuite { diff --git a/acme_src/ErrorConditions/BeforeAllAttributeOnNotTestCaseOrTestSuite/BadTestCase.php b/acme_src/ErrorConditions/BeforeAllAttributeOnNotTestCaseOrTestSuite/BadTestCase.php index 17b8d44..697e473 100644 --- a/acme_src/ErrorConditions/BeforeAllAttributeOnNotTestCaseOrTestSuite/BadTestCase.php +++ b/acme_src/ErrorConditions/BeforeAllAttributeOnNotTestCaseOrTestSuite/BadTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ErrorConditions\BeforeAllAttributeOnNotTestCaseOrTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; class BadTestCase { diff --git a/acme_src/ErrorConditions/BeforeAllNonStaticMethod/BadTestCase.php b/acme_src/ErrorConditions/BeforeAllNonStaticMethod/BadTestCase.php index 6f24cac..bb15fa9 100644 --- a/acme_src/ErrorConditions/BeforeAllNonStaticMethod/BadTestCase.php +++ b/acme_src/ErrorConditions/BeforeAllNonStaticMethod/BadTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ErrorConditions\BeforeAllNonStaticMethod; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class BadTestCase extends TestCase { diff --git a/acme_src/ErrorConditions/BeforeEachAttributeOnNotTestCaseOrTestSuite/BadTestCase.php b/acme_src/ErrorConditions/BeforeEachAttributeOnNotTestCaseOrTestSuite/BadTestCase.php index abec50b..ca3e2d9 100644 --- a/acme_src/ErrorConditions/BeforeEachAttributeOnNotTestCaseOrTestSuite/BadTestCase.php +++ b/acme_src/ErrorConditions/BeforeEachAttributeOnNotTestCaseOrTestSuite/BadTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ErrorConditions\BeforeEachAttributeOnNotTestCaseOrTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\Test; class BadTestCase { diff --git a/acme_src/ErrorConditions/NoTestsTestCase/BadTestCase.php b/acme_src/ErrorConditions/NoTestsTestCase/BadTestCase.php index 3240180..03f017d 100644 --- a/acme_src/ErrorConditions/NoTestsTestCase/BadTestCase.php +++ b/acme_src/ErrorConditions/NoTestsTestCase/BadTestCase.php @@ -2,7 +2,7 @@ namespace Acme\DemoSuites\ErrorConditions\NoTestsTestCase; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\TestCase; class BadTestCase extends TestCase { diff --git a/acme_src/ErrorConditions/TestAttributeOnNotTestCase/BadTestCase.php b/acme_src/ErrorConditions/TestAttributeOnNotTestCase/BadTestCase.php index 3d09943..17c3aaa 100644 --- a/acme_src/ErrorConditions/TestAttributeOnNotTestCase/BadTestCase.php +++ b/acme_src/ErrorConditions/TestAttributeOnNotTestCase/BadTestCase.php @@ -2,7 +2,7 @@ namespace Acme\DemoSuites\ErrorConditions\TestAttributeOnNotTestCase; -use Cspray\Labrador\AsyncUnit\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\Test; class BadTestCase { diff --git a/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/FirstTestCase.php b/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/FirstTestCase.php index 8a98d4e..3833ea5 100644 --- a/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/FirstTestCase.php @@ -2,19 +2,19 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterAllTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function ensureSuiteCounter() : void { - $this->assert()->intEquals(0, $this->testSuite()->getCounter()); + $this->assert->intEquals(0, $this->testSuite->getCounter()); } #[Test] public function ensureSuiteCounterAgain() : void { - $this->assert()->intEquals(0, $this->testSuite()->getCounter()); + $this->assert->intEquals(0, $this->testSuite->getCounter()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/MyTestSuite.php b/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/MyTestSuite.php index f36edd6..ad19878 100644 --- a/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterAllTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/SecondTestCase.php b/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/SecondTestCase.php index e1f87e2..b8f0a22 100644 --- a/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/AfterAllTestSuiteHook/SecondTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterAllTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class SecondTestCase extends TestCase { #[Test] public function ensureSuiteCounter() : void { - $this->assert()->intEquals(0, $this->testSuite()->getCounter()); + $this->assert->intEquals(0, $this->testSuite->getCounter()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/FirstTestCase.php b/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/FirstTestCase.php index c4e1235..f3406a6 100644 --- a/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/FirstTestCase.php @@ -2,24 +2,24 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function testSomething() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } #[Test] public function testSomethingElse() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } #[Test] public function testItAgain() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/MyTestSuite.php b/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/MyTestSuite.php index de6525f..a96e5a4 100644 --- a/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/SecondTestCase.php b/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/SecondTestCase.php index 4555ee8..97a25eb 100644 --- a/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/SecondTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class SecondTestCase extends TestCase { #[Test] public function ensureIntEquals() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/ThirdTestCase.php b/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/ThirdTestCase.php index 4f4cae4..e4ef6df 100644 --- a/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/ThirdTestCase.php +++ b/acme_src/ExplicitTestSuite/AfterEachTestSuiteHook/ThirdTestCase.php @@ -2,19 +2,19 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class ThirdTestCase extends TestCase { #[Test] public function testFoo() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } #[Test] public function testBar() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/FirstTestCase.php b/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/FirstTestCase.php index 4743a91..f8e5ec6 100644 --- a/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/FirstTestCase.php @@ -2,24 +2,24 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function testSomething() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } #[Test] public function testSomethingElse() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } #[Test] public function testItAgain() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/MyTestSuite.php b/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/MyTestSuite.php index 0b3e40a..677776e 100644 --- a/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterEachTest; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/SecondTestCase.php b/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/SecondTestCase.php index 5c432a3..171f468 100644 --- a/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/SecondTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class SecondTestCase extends TestCase { #[Test] public function ensureIntEquals() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/ThirdTestCase.php b/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/ThirdTestCase.php index 0c91709..c785a79 100644 --- a/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/ThirdTestCase.php +++ b/acme_src/ExplicitTestSuite/AfterEachTestTestSuiteHook/ThirdTestCase.php @@ -2,19 +2,19 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AfterEachTestTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class ThirdTestCase extends TestCase { #[Test] public function testFoo() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } #[Test] public function testBar() : void { - $this->assert()->arrayEquals([], $this->testSuite()->getState()); + $this->assert->arrayEquals([], $this->testSuite->getState()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/AnnotatedDefaultTestSuite/MyTestCase.php b/acme_src/ExplicitTestSuite/AnnotatedDefaultTestSuite/MyTestCase.php index c1cee3e..9aa5445 100644 --- a/acme_src/ExplicitTestSuite/AnnotatedDefaultTestSuite/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/AnnotatedDefaultTestSuite/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AnnotatedDefaultTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { @@ -15,8 +15,8 @@ public function getTestSuiteName() : ?string { #[Test] public function ensureSomething() { - $this->testSuiteName = $this->testSuite()->getName(); - $this->assert()->stringEquals(MyTestSuite::class, $this->testSuiteName); + $this->testSuiteName = $this->testSuite->getName(); + $this->assert->stringEquals(MyTestSuite::class, $this->testSuiteName); } diff --git a/acme_src/ExplicitTestSuite/AnnotatedDefaultTestSuite/MyTestSuite.php b/acme_src/ExplicitTestSuite/AnnotatedDefaultTestSuite/MyTestSuite.php index 809baee..8f6be6b 100644 --- a/acme_src/ExplicitTestSuite/AnnotatedDefaultTestSuite/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/AnnotatedDefaultTestSuite/MyTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\AnnotatedDefaultTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite {} \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/FirstTestCase.php b/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/FirstTestCase.php index ec7b57a..b377ab4 100644 --- a/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/FirstTestCase.php @@ -2,19 +2,19 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeAllTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function ensureSuiteCounter() : void { - $this->assert()->intEquals(1, $this->testSuite()->getCounter()); + $this->assert->intEquals(1, $this->testSuite->getCounter()); } #[Test] public function ensureSuiteCounterAgain() : void { - $this->assert()->intEquals(1, $this->testSuite()->getCounter()); + $this->assert->intEquals(1, $this->testSuite->getCounter()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/MyTestSuite.php b/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/MyTestSuite.php index d50701f..0d2e5f0 100644 --- a/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeAllTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/SecondTestCase.php b/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/SecondTestCase.php index 13ad0b0..678b6e9 100644 --- a/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/BeforeAllTestSuiteHook/SecondTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeAllTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class SecondTestCase extends TestCase { #[Test] public function ensureSuiteCounter() : void { - $this->assert()->intEquals(1, $this->testSuite()->getCounter()); + $this->assert->intEquals(1, $this->testSuite->getCounter()); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/FirstTestCase.php b/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/FirstTestCase.php index a181291..cd71aa1 100644 --- a/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/FirstTestCase.php @@ -2,19 +2,19 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeEachTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function testSomething() : void { - $this->assert()->stringEquals('foo', 'foo'); + $this->assert->stringEquals('foo', 'foo'); } #[Test] public function testSomethingElse() : void { - $this->assert()->stringEquals('bar', 'bar'); + $this->assert->stringEquals('bar', 'bar'); } /** @@ -22,7 +22,7 @@ public function testSomethingElse() : void { */ #[Test] public function testItAgain() : void { - $this->assert()->stringEquals('baz', 'baz'); + $this->assert->stringEquals('baz', 'baz'); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/MyTestSuite.php b/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/MyTestSuite.php index 544260e..8828b4b 100644 --- a/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeEachTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/SecondTestCase.php b/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/SecondTestCase.php index 20107e8..65d7386 100644 --- a/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/SecondTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeEachTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class SecondTestCase extends TestCase { #[Test] public function ensureIntEquals() : void { - $this->assert()->intEquals(1, 1); + $this->assert->intEquals(1, 1); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/ThirdTestCase.php b/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/ThirdTestCase.php index be291c7..203f816 100644 --- a/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/ThirdTestCase.php +++ b/acme_src/ExplicitTestSuite/BeforeEachTestSuiteHook/ThirdTestCase.php @@ -2,19 +2,19 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeEachTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class ThirdTestCase extends TestCase { #[Test] public function testFoo() : void { - $this->assert()->isNull(null); + $this->assert->isNull(null); } #[Test] public function testBar() : void { - $this->assert()->isTrue(true); + $this->assert->isTrue(true); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/FirstTestCase.php b/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/FirstTestCase.php index 315fb30..810ae9f 100644 --- a/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/FirstTestCase.php @@ -2,24 +2,24 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeEachTestTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function testSomething() : void { - $this->assert()->arrayEquals('foo', 'foo'); + $this->assert->arrayEquals('foo', 'foo'); } #[Test] public function testSomethingElse() : void { - $this->assert()->stringEquals('bar', 'bar'); + $this->assert->stringEquals('bar', 'bar'); } #[Test] public function testItAgain() : void { - $this->assert()->stringEquals('baz', 'baz'); + $this->assert->stringEquals('baz', 'baz'); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/MyTestSuite.php b/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/MyTestSuite.php index a440eab..3deec50 100644 --- a/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeEachTestTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEachTest; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/SecondTestCase.php b/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/SecondTestCase.php index 0fc72d9..b711033 100644 --- a/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/SecondTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeEachTestTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class SecondTestCase extends TestCase { #[Test] public function ensureIntEquals() : void { - $this->assert()->intEquals(1, 1); + $this->assert->intEquals(1, 1); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/ThirdTestCase.php b/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/ThirdTestCase.php index b73c81a..e851834 100644 --- a/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/ThirdTestCase.php +++ b/acme_src/ExplicitTestSuite/BeforeEachTestTestSuiteHook/ThirdTestCase.php @@ -2,19 +2,19 @@ namespace Acme\DemoSuites\ExplicitTestSuite\BeforeEachTestTestSuiteHook; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class ThirdTestCase extends TestCase { #[Test] public function testFoo() : void { - $this->assert()->isNull(null); + $this->assert->isNull(null); } #[Test] public function testBar() : void { - $this->assert()->isTrue(true); + $this->assert->isTrue(true); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterAll/FirstTestCase.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterAll/FirstTestCase.php index 421303d..cd70967 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterAll/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterAll/FirstTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteAfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function ensureSomething() { - $this->assert()->isTrue(true); + $this->assert->isTrue(true); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterAll/MyTestSuite.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterAll/MyTestSuite.php index d93f06a..00095c5 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterAll/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterAll/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteAfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; use RuntimeException; #[DefaultTestSuite] diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEach/MyTestCase.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEach/MyTestCase.php index 5d0b8ce..7c7515b 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEach/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEach/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteAfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEach/MyTestSuite.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEach/MyTestSuite.php index 1712950..9294702 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEach/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEach/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteAfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEachTest/MyTestCase.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEachTest/MyTestCase.php index dfaaba0..f20dfa0 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEachTest/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEachTest/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteAfterEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEachTest/MyTestSuite.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEachTest/MyTestSuite.php index 5b74e9e..bad02cb 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEachTest/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteAfterEachTest/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteAfterEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterEachTest; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeAll/FirstTestCase.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeAll/FirstTestCase.php index a0d8a55..f7e4ecb 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeAll/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeAll/FirstTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteBeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function ensureSomething() { - $this->assert()->isTrue(true); + $this->assert->isTrue(true); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeAll/MyTestSuite.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeAll/MyTestSuite.php index bf84ae1..77bc977 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeAll/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeAll/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteBeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEach/MyTestCase.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEach/MyTestCase.php index c47e0f1..fddb8f1 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEach/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEach/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteBeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEach/MyTestSuite.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEach/MyTestSuite.php index b414387..334f51d 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEach/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEach/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteBeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEachTest/MyTestCase.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEachTest/MyTestCase.php index 80ee5a2..777f8a2 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEachTest/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEachTest/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteBeforeEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEachTest/MyTestSuite.php b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEachTest/MyTestSuite.php index 0c7e877..053f116 100644 --- a/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEachTest/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/ExceptionThrowingTestSuiteBeforeEachTest/MyTestSuite.php @@ -2,10 +2,10 @@ namespace Acme\DemoSuites\ExplicitTestSuite\ExceptionThrowingTestSuiteBeforeEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEachTest; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/TestCaseAfterAllHasTestSuiteState/MyTestCase.php b/acme_src/ExplicitTestSuite/TestCaseAfterAllHasTestSuiteState/MyTestCase.php index 31ba1ff..14c377b 100644 --- a/acme_src/ExplicitTestSuite/TestCaseAfterAllHasTestSuiteState/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/TestCaseAfterAllHasTestSuiteState/MyTestCase.php @@ -2,10 +2,10 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseAfterAllHasTestSuiteState; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestCase extends TestCase { @@ -18,7 +18,7 @@ public static function setState(TestSuite $testSuite) { #[Test] public function checkState() { - $this->assert()->isNull(self::$state); + $this->assert->isNull(self::$state); } public function getState() : ?string { diff --git a/acme_src/ExplicitTestSuite/TestCaseAfterAllHasTestSuiteState/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestCaseAfterAllHasTestSuiteState/MyTestSuite.php index 2755400..7b16d50 100644 --- a/acme_src/ExplicitTestSuite/TestCaseAfterAllHasTestSuiteState/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestCaseAfterAllHasTestSuiteState/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseAfterAllHasTestSuiteState; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/TestCaseBeforeAllHasTestSuiteState/MyTestCase.php b/acme_src/ExplicitTestSuite/TestCaseBeforeAllHasTestSuiteState/MyTestCase.php index 9deff6d..70b8679 100644 --- a/acme_src/ExplicitTestSuite/TestCaseBeforeAllHasTestSuiteState/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/TestCaseBeforeAllHasTestSuiteState/MyTestCase.php @@ -2,10 +2,10 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseBeforeAllHasTestSuiteState; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestCase extends TestCase { @@ -18,7 +18,7 @@ public static function setState(TestSuite $testSuite) { #[Test] public function checkState() { - $this->assert()->stringEquals('AsyncUnit', self::$state); + $this->assert->stringEquals('AsyncUnit', self::$state); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestCaseBeforeAllHasTestSuiteState/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestCaseBeforeAllHasTestSuiteState/MyTestSuite.php index a9c899b..3a48863 100644 --- a/acme_src/ExplicitTestSuite/TestCaseBeforeAllHasTestSuiteState/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestCaseBeforeAllHasTestSuiteState/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseBeforeAllHasTestSuiteState; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/FirstTestCase.php b/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/FirstTestCase.php index e2926ab..fc690d7 100644 --- a/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/FirstTestCase.php @@ -4,14 +4,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseDefinedAndImplicitDefaultTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function ensureSomething() { - $this->assert()->stringEquals('AsyncUnit', 'AsyncUnit'); + $this->assert->stringEquals('AsyncUnit', 'AsyncUnit'); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/MyTestSuite.php index 08ac05d..54f7b1a 100644 --- a/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/MyTestSuite.php @@ -2,6 +2,6 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseDefinedAndImplicitDefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestSuite extends TestSuite {} \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/SecondTestCase.php b/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/SecondTestCase.php index 1a1baf0..7ca63cd 100644 --- a/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/TestCaseDefinedAndImplicitDefaultTestSuite/SecondTestCase.php @@ -4,16 +4,16 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseDefinedAndImplicitDefaultTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(MyTestSuite::class)] class SecondTestCase extends TestCase { #[Test] public function ensureSomething() { - $this->assert()->isFalse(false); + $this->assert->isFalse(false); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/FirstTestCase.php b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/FirstTestCase.php index 65564eb..c305f34 100644 --- a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/FirstTestCase.php @@ -2,15 +2,15 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseDefinesTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite as TestSuiteAttribute; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite as TestSuiteAttribute; +use Labrador\AsyncUnit\Framework\TestCase; #[TestSuiteAttribute(MyFirstTestSuite::class)] class FirstTestCase extends TestCase { #[Test] public function ensureIntEquals() { - $this->assert()->intEquals(42, 42); + $this->assert->intEquals(42, 42); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/MyFirstTestSuite.php b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/MyFirstTestSuite.php index edbaafb..1701b26 100644 --- a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/MyFirstTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/MyFirstTestSuite.php @@ -2,6 +2,6 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseDefinesTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; class MyFirstTestSuite extends TestSuite {} \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/MySecondTestSuite.php b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/MySecondTestSuite.php index 16440dd..d45c25e 100644 --- a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/MySecondTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/MySecondTestSuite.php @@ -2,6 +2,6 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseDefinesTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; class MySecondTestSuite extends TestSuite {} \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/SecondTestCase.php b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/SecondTestCase.php index 2825300..db26ea5 100644 --- a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/SecondTestCase.php @@ -3,9 +3,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseDefinesTestSuite; use Amp\Future; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite as TestSuiteAttribute; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite as TestSuiteAttribute; use Generator; #[TestSuiteAttribute(MySecondTestSuite::class)] @@ -13,7 +13,7 @@ class SecondTestCase extends TestCase { #[Test] public function ensureSomethingIsNull() : void { - $this->asyncAssert()->isNull(Future::complete()); + $this->assert->isNull(null); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/ThirdTestCase.php b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/ThirdTestCase.php index daaedfa..fdcc0af 100644 --- a/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/ThirdTestCase.php +++ b/acme_src/ExplicitTestSuite/TestCaseDefinesTestSuite/ThirdTestCase.php @@ -2,16 +2,16 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestCaseDefinesTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite as TestSuiteAttribute; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite as TestSuiteAttribute; +use Labrador\AsyncUnit\Framework\TestCase; #[TestSuiteAttribute(MySecondTestSuite::class)] class ThirdTestCase extends TestCase { #[Test] public function ensureStringEquals() { - $this->assert()->stringEquals('AsyncUnit', 'AsyncUnit'); + $this->assert->stringEquals('AsyncUnit', 'AsyncUnit'); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/HasExplicitTestSuite/MyTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/HasExplicitTestSuite/MyTestCase.php index d17b44f..c69580e 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/HasExplicitTestSuite/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/HasExplicitTestSuite/MyTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDefinesNamespaceToAttach\HasExplicitTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function testSomething() { - $this->assert()->isFalse(false); + $this->assert->isFalse(false); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/HasImplicitTestSuite/MyTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/HasImplicitTestSuite/MyTestCase.php index 726e058..9ee5829 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/HasImplicitTestSuite/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/HasImplicitTestSuite/MyTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDefinesNamespaceToAttach\HasImplicitTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function testSomething() { - $this->assert()->isTrue(true); + $this->assert->isTrue(true); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/MyTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/MyTestCase.php index 7d117b1..38dc05c 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/MyTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDefinesNamespaceToAttach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function testSomething() { - $this->assert()->stringEquals('AsyncUnit', 'AsyncUnit'); + $this->assert->stringEquals('AsyncUnit', 'AsyncUnit'); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/MyTestSuite.php index 32bc253..71031f3 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDefinesNamespaceToAttach/MyTestSuite.php @@ -2,7 +2,7 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDefinesNamespaceToAttach; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/TestSuiteDisabled/FirstTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteDisabled/FirstTestCase.php index ad919d0..185dde9 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDisabled/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDisabled/FirstTestCase.php @@ -3,9 +3,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDisabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(MyTestSuite::class)] class FirstTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/TestSuiteDisabled/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestSuiteDisabled/MyTestSuite.php index e0cd0dd..4a9ee5c 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDisabled/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDisabled/MyTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDisabled; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\TestSuite; #[Disabled] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/TestSuiteDisabled/SecondTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteDisabled/SecondTestCase.php index fd266a3..ea1e2a5 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDisabled/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDisabled/SecondTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDisabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(MyTestSuite::class)] class SecondTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/TestSuiteDisabledCustomMessage/MyTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteDisabledCustomMessage/MyTestCase.php index 770ff3e..139ec8e 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDisabledCustomMessage/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDisabledCustomMessage/MyTestCase.php @@ -4,9 +4,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDisabledCustomMessage; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(MyTestSuite::class)] class MyTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/TestSuiteDisabledCustomMessage/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestSuiteDisabledCustomMessage/MyTestSuite.php index b45ebfb..bef9643 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDisabledCustomMessage/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDisabledCustomMessage/MyTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDisabledCustomMessage; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\TestSuite; #[Disabled('The AttachToTestSuite is disabled')] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/TestSuiteDisabledHookNotInvoked/MyTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteDisabledHookNotInvoked/MyTestCase.php index 4ec241f..51f3e66 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDisabledHookNotInvoked/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDisabledHookNotInvoked/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDisabledHookNotInvoked; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(MyTestSuite::class)] class MyTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/TestSuiteDisabledHookNotInvoked/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestSuiteDisabledHookNotInvoked/MyTestSuite.php index f856b2d..5d2fceb 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteDisabledHookNotInvoked/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestSuiteDisabledHookNotInvoked/MyTestSuite.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteDisabledHookNotInvoked; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\AfterEachTest; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEachTest; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\TestSuite; #[Disabled] class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/FirstTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/FirstTestCase.php index b9334ae..46c1e3c 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/FirstTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteHasTimeout; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/MyTestSuite.php index 3755c45..a9129a8 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteHasTimeout; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Timeout; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\Attribute\Timeout; +use Labrador\AsyncUnit\Framework\TestSuite; #[Timeout(125)] #[DefaultTestSuite] diff --git a/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/SecondTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/SecondTestCase.php index ed0672e..617ec66 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/SecondTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteHasTimeout/SecondTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteHasTimeout; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class SecondTestCase extends TestCase { diff --git a/acme_src/ExplicitTestSuite/TestSuiteHookPriority/MyTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteHookPriority/MyTestCase.php index 0fb8f14..86357c1 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteHookPriority/MyTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteHookPriority/MyTestCase.php @@ -2,16 +2,16 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteHookPriority; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(MyTestSuite::class)] class MyTestCase extends TestCase { #[Test] public function testSomething() { - $this->assert()->isTrue(true); + $this->assert->isTrue(true); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestSuiteHookPriority/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestSuiteHookPriority/MyTestSuite.php index 048d6f8..6eb567f 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteHookPriority/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestSuiteHookPriority/MyTestSuite.php @@ -2,13 +2,13 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteHookPriority; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEachTest; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEachTest; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\AfterEachTest; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEachTest; +use Labrador\AsyncUnit\Framework\TestSuite; class MyTestSuite extends TestSuite { diff --git a/acme_src/ExplicitTestSuite/TestSuiteStateBeforeAll/FirstTestCase.php b/acme_src/ExplicitTestSuite/TestSuiteStateBeforeAll/FirstTestCase.php index 23edc4f..e85211a 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteStateBeforeAll/FirstTestCase.php +++ b/acme_src/ExplicitTestSuite/TestSuiteStateBeforeAll/FirstTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteStateBeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function checkTestSuiteData() { - $this->assert()->stringEquals('bar', $this->testSuite()->get('foo')); + $this->assert->stringEquals('bar', $this->testSuite->get('foo')); } } \ No newline at end of file diff --git a/acme_src/ExplicitTestSuite/TestSuiteStateBeforeAll/MyTestSuite.php b/acme_src/ExplicitTestSuite/TestSuiteStateBeforeAll/MyTestSuite.php index 8a10ccc..9fea270 100644 --- a/acme_src/ExplicitTestSuite/TestSuiteStateBeforeAll/MyTestSuite.php +++ b/acme_src/ExplicitTestSuite/TestSuiteStateBeforeAll/MyTestSuite.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ExplicitTestSuite\TestSuiteStateBeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\DefaultTestSuite; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\DefaultTestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; #[DefaultTestSuite] class MyTestSuite extends TestSuite { diff --git a/acme_src/ImplicitDefaultTestSuite/CustomAssertions/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/CustomAssertions/MyTestCase.php index 9eadf21..02aa4c8 100644 --- a/acme_src/ImplicitDefaultTestSuite/CustomAssertions/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/CustomAssertions/MyTestCase.php @@ -3,15 +3,14 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\CustomAssertions; use Amp\Future; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function ensureCustomAssertionsPass() { - $this->assert()->theCustomAssertion('foo', 'bar'); - $this->asyncAssert()->theCustomAssertion('foo', Future::complete('bar')); + $this->assert->theCustomAssertion('foo', 'bar'); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingAfterAll/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingAfterAll/MyTestCase.php index 6efa388..e21faf6 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingAfterAll/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingAfterAll/MyTestCase.php @@ -4,9 +4,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExceptionThrowingAfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingAfterEach/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingAfterEach/MyTestCase.php index db7dbaa..3be316a 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingAfterEach/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingAfterEach/MyTestCase.php @@ -4,9 +4,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExceptionThrowingAfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingBeforeAll/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingBeforeAll/MyTestCase.php index 8cddd79..60ac922 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingBeforeAll/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingBeforeAll/MyTestCase.php @@ -4,9 +4,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExceptionThrowingBeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingBeforeEach/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingBeforeEach/MyTestCase.php index 41f5060..56b4b5d 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingBeforeEach/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingBeforeEach/MyTestCase.php @@ -4,9 +4,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExceptionThrowingBeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingTest/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingTest/MyTestCase.php index 9dce471..23a14d4 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingTest/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingTest/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExceptionThrowingTest; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingTestWithAfterEachHook/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingTestWithAfterEachHook/MyTestCase.php index c5d9b71..7678fa8 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingTestWithAfterEachHook/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExceptionThrowingTestWithAfterEachHook/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExceptionThrowingTestWithAfterEachHook; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/AbstractFourthTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/AbstractFourthTestCase.php index 05a6b9b..596c105 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/AbstractFourthTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/AbstractFourthTestCase.php @@ -2,16 +2,16 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExtendedTestCases; -use Cspray\Labrador\AsyncUnit\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\Test; abstract class AbstractFourthTestCase extends ThirdTestCase { #[Test] public function fourthEnsureSomething() { - $this->assert()->isNull(null); - $this->assert()->isFalse(false); - $this->assert()->isTrue(true); - $this->assert()->stringEquals('AsyncUnit', 'AsyncUnit'); + $this->assert->isNull(null); + $this->assert->isFalse(false); + $this->assert->isTrue(true); + $this->assert->stringEquals('AsyncUnit', 'AsyncUnit'); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/AbstractSecondTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/AbstractSecondTestCase.php index 5e4b7ff..c51fc92 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/AbstractSecondTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/AbstractSecondTestCase.php @@ -5,14 +5,14 @@ use Amp\Future; -use Cspray\Labrador\AsyncUnit\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\Test; abstract class AbstractSecondTestCase extends FirstTestCase { #[Test] public function secondEnsureSomething() { - $this->assert()->intEquals(42, 42); - $this->asyncAssert()->isFalse(Future::complete(false)); + $this->assert->intEquals(42, 42); + $this->assert->isFalse(false); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/FifthTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/FifthTestCase.php index 2a6c54e..6dcc70b 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/FifthTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/FifthTestCase.php @@ -2,17 +2,17 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExtendedTestCases; -use Cspray\Labrador\AsyncUnit\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\Test; class FifthTestCase extends AbstractFourthTestCase { #[Test] public function fifthEnsureSomething() { - $this->assert()->isFalse(false); - $this->assert()->not()->stringEquals('AsyncUnit', 'PHPUnit'); - $this->assert()->intEquals(1, 1); - $this->assert()->floatEquals(3.14, 3.14); - $this->assert()->isTrue(false); + $this->assert->isFalse(false); + $this->assert->not()->stringEquals('AsyncUnit', 'PHPUnit'); + $this->assert->intEquals(1, 1); + $this->assert->floatEquals(3.14, 3.14); + $this->assert->isTrue(false); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/FirstTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/FirstTestCase.php index 670d0d2..8f47105 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/FirstTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/FirstTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExtendedTestCases; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { #[Test] public function firstEnsureSomething() { - $this->assert()->stringEquals('foo', 'foo'); + $this->assert->stringEquals('foo', 'foo'); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/ThirdTestCase.php b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/ThirdTestCase.php index ebd20f0..0a37b7f 100644 --- a/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/ThirdTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/ExtendedTestCases/ThirdTestCase.php @@ -3,15 +3,15 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\ExtendedTestCases; use Amp\Future; -use Cspray\Labrador\AsyncUnit\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\Test; class ThirdTestCase extends AbstractSecondTestCase { #[Test] public function thirdEnsureSomething() { - $this->asyncAssert()->arrayEquals([1,2,3], Future::complete([1,2,3])); - $this->assert()->stringEquals('bar', 'bar'); - $this->assert()->isNull(null); + $this->assert->arrayEquals([1,2,3], [1,2,3]); + $this->assert->stringEquals('bar', 'bar'); + $this->assert->isNull(null); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/FailedAssertion/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/FailedAssertion/MyTestCase.php index 44bd0f5..3907200 100644 --- a/acme_src/ImplicitDefaultTestSuite/FailedAssertion/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/FailedAssertion/MyTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\FailedAssertion; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function alwaysFails() { - $this->assert()->stringEquals('foo', 'bar'); + $this->assert->stringEquals('foo', 'bar'); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/FailedNotAssertion/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/FailedNotAssertion/MyTestCase.php index 0fa65fc..0c7d5d4 100644 --- a/acme_src/ImplicitDefaultTestSuite/FailedNotAssertion/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/FailedNotAssertion/MyTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\FailedNotAssertion; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function checkFailedNotAssertion() { - $this->assert()->not()->stringEquals('foo', 'foo'); + $this->assert->not()->stringEquals('foo', 'foo'); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/HandleNonPhpFiles/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/HandleNonPhpFiles/MyTestCase.php index 9ec2cef..9aeb0e5 100644 --- a/acme_src/ImplicitDefaultTestSuite/HandleNonPhpFiles/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/HandleNonPhpFiles/MyTestCase.php @@ -3,8 +3,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HandleNonPhpFiles; use Amp\Future; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyCustomAssertionPlugin.php b/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyCustomAssertionPlugin.php index 869ccde..8db7d93 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyCustomAssertionPlugin.php +++ b/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyCustomAssertionPlugin.php @@ -3,8 +3,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasAssertionPlugin; -use Cspray\Labrador\AsyncUnit\Context\CustomAssertionContext; -use Cspray\Labrador\AsyncUnit\CustomAssertionPlugin; +use Labrador\AsyncUnit\Framework\Context\CustomAssertionContext; +use Labrador\AsyncUnit\Framework\Plugin\CustomAssertionPlugin; class MyCustomAssertionPlugin implements CustomAssertionPlugin { diff --git a/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyOtherCustomAssertionPlugin.php b/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyOtherCustomAssertionPlugin.php index b1818ff..b4aa2b9 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyOtherCustomAssertionPlugin.php +++ b/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyOtherCustomAssertionPlugin.php @@ -3,9 +3,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasAssertionPlugin; use Countable; -use Cspray\Labrador\AsyncUnit\Assertion\AssertIsTrue; -use Cspray\Labrador\AsyncUnit\Context\CustomAssertionContext; -use Cspray\Labrador\AsyncUnit\CustomAssertionPlugin; +use Labrador\AsyncUnit\Framework\Assertion\AssertIsTrue; +use Labrador\AsyncUnit\Framework\Context\CustomAssertionContext; +use Labrador\AsyncUnit\Framework\Plugin\CustomAssertionPlugin; use Stringable; class MyOtherCustomAssertionPlugin implements Countable, Stringable, CustomAssertionPlugin { diff --git a/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyTestCase.php index 388425d..2df05de 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/HasAssertionPlugin/MyTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasAssertionPlugin; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function ensureSomething() { - $this->assert()->myOtherCustomAssertion(); + $this->assert->myOtherCustomAssertion(); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/HasDataProvider/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/HasDataProvider/MyTestCase.php index 5b3a067..ab0868f 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasDataProvider/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/HasDataProvider/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasDataProvider; -use Cspray\Labrador\AsyncUnit\Attribute\DataProvider; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\DataProvider; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { @@ -22,7 +22,7 @@ public function myDataProvider() : array { #[DataProvider('myDataProvider')] public function ensureStringsEqual(string $expected, string $actual) : void { $this->counter++; - $this->assert()->stringEquals($expected, $actual); + $this->assert->stringEquals($expected, $actual); } public function getCounter() : int { diff --git a/acme_src/ImplicitDefaultTestSuite/HasNotTestCaseObject/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/HasNotTestCaseObject/MyTestCase.php index 16d54f8..b20859d 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasNotTestCaseObject/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/HasNotTestCaseObject/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasNotTestCaseObject; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/HasResultPrinterPlugin/MyResultPrinterPlugin.php b/acme_src/ImplicitDefaultTestSuite/HasResultPrinterPlugin/MyResultPrinterPlugin.php index c151178..3465204 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasResultPrinterPlugin/MyResultPrinterPlugin.php +++ b/acme_src/ImplicitDefaultTestSuite/HasResultPrinterPlugin/MyResultPrinterPlugin.php @@ -4,32 +4,27 @@ use Amp\ByteStream\WritableStream; use Amp\Future; -use Cspray\Labrador\AsyncUnit\ResultPrinterPlugin; -use Cspray\Labrador\AsyncUnit\Events; -use Labrador\AsyncEvent\AbstractListener; +use Labrador\AsyncEvent\Emitter; use Labrador\AsyncEvent\Event; -use Labrador\AsyncEvent\EventEmitter; -use Labrador\AsyncEvent\OneTimeListener; +use Labrador\AsyncEvent\Listener; +use Labrador\AsyncUnit\Framework\Event\Events; +use Labrador\AsyncUnit\Framework\Plugin\ResultPrinterPlugin; use Labrador\CompositeFuture\CompositeFuture; class MyResultPrinterPlugin implements ResultPrinterPlugin { - public function registerEvents(EventEmitter $emitter, WritableStream $output) : void { - $listener = new class($output) extends AbstractListener { + public function registerEvents(Emitter $emitter, WritableStream $output) : void { + $listener = new class($output) implements Listener { public function __construct( private readonly WritableStream $output ) {} - public function canHandle(string $eventName) : bool { - return $eventName === Events::TEST_PROCESSED; - } - public function handle(Event $event) : Future|CompositeFuture|null { - $this->output->write($event->getTarget()->getTestCase()::class . "\n"); - $this->output->write($event->getTarget()->getTestMethod() . "\n"); + $this->output->write($event->payload()->getTestCase()::class . "\n"); + $this->output->write($event->payload()->getTestMethod() . "\n"); } }; - $emitter->register(new OneTimeListener($listener)); + $emitter->register(Events::TEST_PROCESSED, $listener); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/HasResultPrinterPlugin/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/HasResultPrinterPlugin/MyTestCase.php index a796f13..70dc81f 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasResultPrinterPlugin/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/HasResultPrinterPlugin/MyTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasResultPrinterPlugin; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function checkSomething() { - $this->assert()->stringEquals('foo', 'foo'); + $this->assert->stringEquals('foo', 'foo'); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/HasSingleAfterAllHook/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/HasSingleAfterAllHook/MyTestCase.php index 551f227..ab3d13f 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasSingleAfterAllHook/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/HasSingleAfterAllHook/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasSingleAfterAllHook; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/HasSingleAfterEachHook/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/HasSingleAfterEachHook/MyTestCase.php index ae8b7ee..efadb3a 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasSingleAfterEachHook/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/HasSingleAfterEachHook/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasSingleAfterEachHook; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/HasSingleBeforeAllHook/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/HasSingleBeforeAllHook/MyTestCase.php index 1958554..58b4095 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasSingleBeforeAllHook/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/HasSingleBeforeAllHook/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasSingleBeforeAllHook; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; use Generator; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/HasSingleBeforeEachHook/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/HasSingleBeforeEachHook/MyTestCase.php index e287454..7f92315 100644 --- a/acme_src/ImplicitDefaultTestSuite/HasSingleBeforeEachHook/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/HasSingleBeforeEachHook/MyTestCase.php @@ -2,10 +2,10 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\HasSingleBeforeEachHook; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/KitchenSink/FirstTestCase.php b/acme_src/ImplicitDefaultTestSuite/KitchenSink/FirstTestCase.php index 7f1b195..3176330 100644 --- a/acme_src/ImplicitDefaultTestSuite/KitchenSink/FirstTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/KitchenSink/FirstTestCase.php @@ -4,22 +4,22 @@ use Amp\Future; use Amp\Success; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(FirstTestSuite::class)] class FirstTestCase extends TestCase { #[Test] public function testOne() { - $this->assert()->countEquals(3, [1, 2, 3]); + $this->assert->countEquals(3, [1, 2, 3]); } #[Test] public function testTwo() { - $this->asyncAssert()->countEquals(4, Future::complete(['a', 'b', 'c', 'd'])); + $this->assert->countEquals(4, ['a', 'b', 'c', 'd']); } #[Test] diff --git a/acme_src/ImplicitDefaultTestSuite/KitchenSink/FirstTestSuite.php b/acme_src/ImplicitDefaultTestSuite/KitchenSink/FirstTestSuite.php index 7e175a3..599133c 100644 --- a/acme_src/ImplicitDefaultTestSuite/KitchenSink/FirstTestSuite.php +++ b/acme_src/ImplicitDefaultTestSuite/KitchenSink/FirstTestSuite.php @@ -2,7 +2,7 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\KitchenSink; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\TestSuite; class FirstTestSuite extends TestSuite { diff --git a/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondBreakfast/BadTestCase.php b/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondBreakfast/BadTestCase.php index 7b0398d..c66308c 100644 --- a/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondBreakfast/BadTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondBreakfast/BadTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\KitchenSink\SecondBreakfast; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class BadTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondBreakfast/FoodAndBeverageTestCase.php b/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondBreakfast/FoodAndBeverageTestCase.php index dfc2ed9..a60faf7 100644 --- a/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondBreakfast/FoodAndBeverageTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondBreakfast/FoodAndBeverageTestCase.php @@ -4,9 +4,9 @@ use Amp\Future; use Amp\Success; -use Cspray\Labrador\AsyncUnit\Attribute\DataProvider; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\DataProvider; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FoodAndBeverageTestCase extends TestCase { @@ -22,7 +22,7 @@ public function foodProvider() { #[Test] #[DataProvider('foodProvider')] public function checkFood(string $a, string $b) { - $this->asyncAssert()->stringEquals($a, Future::complete($b)); + $this->assert->stringEquals($a, $b); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondTestCase.php b/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondTestCase.php index 50ff4a2..c1b28e3 100644 --- a/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/KitchenSink/SecondTestCase.php @@ -4,18 +4,19 @@ use Amp\Future; use Amp\Success; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Context\AssertionContext; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(FirstTestSuite::class)] class SecondTestCase extends TestCase { #[Test] public function checkTwo() { - $this->assert()->instanceOf(TestCase::class, $this); - $this->asyncAssert()->instanceOf(TestCase::class, Future::complete($this)); + $this->assert->instanceOf(TestCase::class, $this); + $this->assert->instanceOf(AssertionContext::class, $this->assert); } #[Test] diff --git a/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/BilboTestCase.php b/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/BilboTestCase.php index c11df89..f0b9d0f 100644 --- a/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/BilboTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/BilboTestCase.php @@ -2,10 +2,10 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\KitchenSink\WhatAbout; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(PotatoTestSuite::class)] class BilboTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/FrodoTestCase.php b/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/FrodoTestCase.php index 8eba58b..dc796f9 100644 --- a/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/FrodoTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/FrodoTestCase.php @@ -2,16 +2,16 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\KitchenSink\WhatAbout; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(PotatoTestSuite::class)] class FrodoTestCase extends TestCase { #[Test] public function isBestHobbit() { - $this->assert()->stringEquals('Frodo', $this->testSuite()->get('bestHobbit')); + $this->assert->stringEquals('Frodo', $this->testSuite->get('bestHobbit')); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/PotatoTestSuite.php b/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/PotatoTestSuite.php index 4d2cac0..6f9e7b8 100644 --- a/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/PotatoTestSuite.php +++ b/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/PotatoTestSuite.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\KitchenSink\WhatAbout; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\TestSuite; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\TestSuite; class PotatoTestSuite extends TestSuite { diff --git a/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/SamwiseTestCase.php b/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/SamwiseTestCase.php index 96a40d6..195fc18 100644 --- a/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/SamwiseTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/KitchenSink/WhatAbout/SamwiseTestCase.php @@ -3,16 +3,16 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\KitchenSink\WhatAbout; -use Cspray\Labrador\AsyncUnit\Attribute\AttachToTestSuite; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AttachToTestSuite; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; #[AttachToTestSuite(PotatoTestSuite::class)] class SamwiseTestCase extends TestCase { #[Test] public function isBestHobbit() { - $this->assert()->stringEquals('Samwise', $this->testSuite()->get('bestHobbit')); + $this->assert->stringEquals('Samwise', $this->testSuite->get('bestHobbit')); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/MockeryTestNoAssertion/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/MockeryTestNoAssertion/MyTestCase.php index 2ae99d0..a78dcd8 100644 --- a/acme_src/ImplicitDefaultTestSuite/MockeryTestNoAssertion/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MockeryTestNoAssertion/MyTestCase.php @@ -2,23 +2,21 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\MockeryTestNoAssertion; -use Amp\Success; -use Cspray\Labrador\Application; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; -use Generator; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Configuration\Configuration; +use Labrador\AsyncUnit\Framework\TestCase; use Mockery\MockInterface; class MyTestCase extends TestCase { #[Test] - public function checkMockExpectations() : Generator { + public function checkMockExpectations() : void { /** @var MockInterface $mock */ - $mock = $this->mocks()->createMock(Application::class); + $mock = $this->mocks()->createMock(Configuration::class); - $mock->expects()->start()->andReturn(new Success()); + $mock->expects()->getTestDirectories()->andReturn([]); - yield $mock->start(); + $mock->getTestDirectories(); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/MultipleBeforeAllHooks/FirstTestCase.php b/acme_src/ImplicitDefaultTestSuite/MultipleBeforeAllHooks/FirstTestCase.php index 4285080..26c483c 100644 --- a/acme_src/ImplicitDefaultTestSuite/MultipleBeforeAllHooks/FirstTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MultipleBeforeAllHooks/FirstTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\MultipleBeforeAllHooks; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FirstTestCase extends TestCase { @@ -17,7 +17,7 @@ public static function setState() : void { #[Test] public function checkState() { - $this->assert()->stringEquals(self::class, self::$state); + $this->assert->stringEquals(self::class, self::$state); } public function getState() : string { diff --git a/acme_src/ImplicitDefaultTestSuite/MultipleBeforeAllHooks/SecondTestCase.php b/acme_src/ImplicitDefaultTestSuite/MultipleBeforeAllHooks/SecondTestCase.php index f069ab1..47109cf 100644 --- a/acme_src/ImplicitDefaultTestSuite/MultipleBeforeAllHooks/SecondTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MultipleBeforeAllHooks/SecondTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\MultipleBeforeAllHooks; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class SecondTestCase extends TestCase { @@ -17,7 +17,7 @@ public static function setStateAgain() : void { #[Test] public function checkState() { - $this->assert()->stringEquals(self::class, self::$state); + $this->assert->stringEquals(self::class, self::$state); } public function getState() : string { diff --git a/acme_src/ImplicitDefaultTestSuite/MultipleTest/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/MultipleTest/MyTestCase.php index 03b2ec2..4d52e24 100644 --- a/acme_src/ImplicitDefaultTestSuite/MultipleTest/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MultipleTest/MyTestCase.php @@ -3,8 +3,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\MultipleTest; use Amp\Delayed; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; use function Amp\async; use function Amp\call; use function Amp\delay; @@ -17,20 +17,20 @@ class MyTestCase extends TestCase { public function ensureSomethingHappens() { delay(0.100); $this->invoked[] = __METHOD__; - $this->assert()->stringEquals('foo', 'foo'); + $this->assert->stringEquals('foo', 'foo'); } #[Test] public function ensureSomethingHappensTwice() { $this->invoked[] = __METHOD__; - $this->assert()->not()->stringEquals('AsyncUnit', 'PHPUnit'); + $this->assert->not()->stringEquals('AsyncUnit', 'PHPUnit'); } #[Test] public function ensureSomethingHappensThreeTimes() { return async(function() { $this->invoked[] = self::class . '::ensureSomethingHappensThreeTimes'; - $this->assert()->intEquals(42, 42); + $this->assert->intEquals(42, 42); }); } diff --git a/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/BarTestCase.php b/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/BarTestCase.php index a02e891..c1d40f9 100644 --- a/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/BarTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/BarTestCase.php @@ -5,8 +5,8 @@ use Amp\Delayed; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class BarTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/BazTestCase.php b/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/BazTestCase.php index 66d8d7e..0c4331c 100644 --- a/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/BazTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/BazTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\MultipleTestCase; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class BazTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/FooTestCase.php b/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/FooTestCase.php index e64c684..f5d3e6f 100644 --- a/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/FooTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MultipleTestCase/FooTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\MultipleTestCase; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; use function Amp\call; class FooTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/FirstTestCase.php b/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/FirstTestCase.php index f342c05..df504f1 100644 --- a/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/FirstTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/FirstTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\MultipleTestsKnownDuration; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; use function Amp\delay; class FirstTestCase extends TestCase { @@ -11,7 +11,7 @@ class FirstTestCase extends TestCase { #[Test] public function checkOne() { delay(0.1); - $this->assert()->arrayEquals([1, 2, 3], [1, 2, 3]); + $this->assert->arrayEquals([1, 2, 3], [1, 2, 3]); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/SecondTestCase.php b/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/SecondTestCase.php index 17d7861..93a2741 100644 --- a/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/SecondTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/SecondTestCase.php @@ -7,8 +7,8 @@ use Amp\Delayed; use Amp\Future; use Amp\Success; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; use function Amp\delay; class SecondTestCase extends TestCase { @@ -22,7 +22,7 @@ public function checkOne() { #[Test] public function checkTwo() { delay(0.1); - $this->assert()->isTrue(true); + $this->assert->isTrue(true); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/ThirdTestCase.php b/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/ThirdTestCase.php index d6bac8f..83f1fe6 100644 --- a/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/ThirdTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/MultipleTestsKnownDuration/ThirdTestCase.php @@ -5,8 +5,8 @@ use Amp\Delayed; use Amp\Future; use Amp\Success; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; use function Amp\delay; class ThirdTestCase extends TestCase { @@ -14,7 +14,7 @@ class ThirdTestCase extends TestCase { #[Test] public function checkOne() { delay(0.1); - $this->assert()->floatEquals(3.14, 3.14); + $this->assert->floatEquals(3.14, 3.14); } #[Test] @@ -26,7 +26,7 @@ public function checkTwo() { #[Test] public function checkThree() { delay(0.1); - $this->assert()->countEquals(2, ['a', 0]); + $this->assert->countEquals(2, ['a', 0]); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/NoAssertions/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/NoAssertions/MyTestCase.php index 8ed694b..9776062 100644 --- a/acme_src/ImplicitDefaultTestSuite/NoAssertions/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/NoAssertions/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\NoAssertions; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/TestOne.php b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/TestOne.php index c308dad..9e4edd5 100644 --- a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/TestOne.php +++ b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/TestOne.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\RecursiveTestLayout; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class TestOne extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/TestTwo.php b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/TestTwo.php index 2d66755..4ff6eb1 100644 --- a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/TestTwo.php +++ b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/TestTwo.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\RecursiveTestLayout\Two; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class TestTwo extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/Four/Five/TestFive.php b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/Four/Five/TestFive.php index a8ea157..6db5e35 100644 --- a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/Four/Five/TestFive.php +++ b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/Four/Five/TestFive.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\RecursiveTestLayout\Two\Three\Four\Five; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class TestFive extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/Four/TestFour.php b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/Four/TestFour.php index 6d34c57..2cf50d3 100644 --- a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/Four/TestFour.php +++ b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/Four/TestFour.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\RecursiveTestLayout\Two\Three\Four; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class TestFour extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/TestThree.php b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/TestThree.php index 7f5a9a5..d510d5b 100644 --- a/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/TestThree.php +++ b/acme_src/ImplicitDefaultTestSuite/RecursiveTestLayout/Two/Three/TestThree.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\RecursiveTestLayout\Two\Three; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class TestThree extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/SingleMockTest/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/SingleMockTest/MyTestCase.php index 9021188..e6eaca8 100644 --- a/acme_src/ImplicitDefaultTestSuite/SingleMockTest/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/SingleMockTest/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\SingleMockTest; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Configuration\Configuration; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Configuration\Configuration; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { @@ -13,7 +13,7 @@ class MyTestCase extends TestCase { #[Test] public function checkCreatingMockObject() { $this->createdMock = $this->mocks()->createMock(Configuration::class); - $this->assert()->not()->isNull($this->createdMock); + $this->assert->not()->isNull($this->createdMock); } public function getCreatedMock() : ?object { diff --git a/acme_src/ImplicitDefaultTestSuite/SingleTest/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/SingleTest/MyTestCase.php index 64f7efb..fe2b8fe 100644 --- a/acme_src/ImplicitDefaultTestSuite/SingleTest/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/SingleTest/MyTestCase.php @@ -3,8 +3,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\SingleTest; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; use Generator; use function Amp\delay; @@ -16,7 +16,7 @@ class MyTestCase extends TestCase { public function ensureSomethingHappens() : void { delay(0.5); $this->testInvoked = true; - $this->assert()->stringEquals('foo', 'foo'); + $this->assert->stringEquals('foo', 'foo'); } public function getTestInvoked() : bool { diff --git a/acme_src/ImplicitDefaultTestSuite/SingleTestAsyncAssertion/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/SingleTestAsyncAssertion/MyTestCase.php deleted file mode 100644 index c7cd74b..0000000 --- a/acme_src/ImplicitDefaultTestSuite/SingleTestAsyncAssertion/MyTestCase.php +++ /dev/null @@ -1,16 +0,0 @@ -asyncAssert()->stringEquals('foo', Future::complete('foo')); - } - -} \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/SingleTestDisabled/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/SingleTestDisabled/MyTestCase.php index ed49af8..d2e7a2a 100644 --- a/acme_src/ImplicitDefaultTestSuite/SingleTestDisabled/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/SingleTestDisabled/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\SingleTestDisabled; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestCaseDisabled/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestCaseDisabled/MyTestCase.php index 2d1ca7b..71d8c9c 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestCaseDisabled/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestCaseDisabled/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestCaseDisabled; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; #[Disabled] class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestCaseDisabledCustomMessage/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestCaseDisabledCustomMessage/MyTestCase.php index d676848..c8d7a7b 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestCaseDisabledCustomMessage/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestCaseDisabledCustomMessage/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestCaseDisabledCustomMessage; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; #[Disabled('The TestCase is disabled')] class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestCaseDisabledHookNotInvoked/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestCaseDisabledHookNotInvoked/MyTestCase.php index 808ce68..c9d62c0 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestCaseDisabledHookNotInvoked/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestCaseDisabledHookNotInvoked/MyTestCase.php @@ -2,13 +2,13 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestCaseDisabledHookNotInvoked; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; #[Disabled] class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestCaseHasTimeout/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestCaseHasTimeout/MyTestCase.php index a92d012..26773d7 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestCaseHasTimeout/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestCaseHasTimeout/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestCaseHasTimeout; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Attribute\Timeout; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\Timeout; +use Labrador\AsyncUnit\Framework\TestCase; #[Timeout(150)] class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestCaseHooksPriority/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestCaseHooksPriority/MyTestCase.php index bb4c239..9e2d690 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestCaseHooksPriority/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestCaseHooksPriority/MyTestCase.php @@ -2,12 +2,12 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestCaseHooksPriority; -use Cspray\Labrador\AsyncUnit\Attribute\AfterAll; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeAll; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterAll; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\BeforeAll; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { @@ -47,7 +47,7 @@ public function beforeEachThree() { #[Test] public function testSomething() { - $this->assert()->stringEquals('AsyncUnit', 'AsyncUnit'); + $this->assert->stringEquals('AsyncUnit', 'AsyncUnit'); } #[AfterEach(1)] diff --git a/acme_src/ImplicitDefaultTestSuite/TestDisabled/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestDisabled/MyTestCase.php index 0d8a440..67b77a8 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestDisabled/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestDisabled/MyTestCase.php @@ -2,15 +2,15 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestDisabled; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function checkSomething() { - $this->assert()->stringEquals('AsyncUnit', 'AsyncUnit'); + $this->assert->stringEquals('AsyncUnit', 'AsyncUnit'); } #[Test] diff --git a/acme_src/ImplicitDefaultTestSuite/TestDisabledCustomMessage/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestDisabledCustomMessage/MyTestCase.php index fd6abe3..8c21b69 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestDisabledCustomMessage/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestDisabledCustomMessage/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestDisabledCustomMessage; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestDisabledEvents/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestDisabledEvents/MyTestCase.php index 07caaa4..f0e1f70 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestDisabledEvents/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestDisabledEvents/MyTestCase.php @@ -3,21 +3,20 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestDisabledEvents; use Amp\Future; -use Amp\Success; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function testFailingFloatEquals() { - $this->asyncAssert()->not()->floatEquals(3.14, Future::complete(3.14)); + $this->assert->not()->floatEquals(3.14, 3.14); } #[Test] public function testIsTrue() { - $this->asyncAssert()->isTrue(Future::complete(true)); + $this->assert->isTrue(true); } #[Test] diff --git a/acme_src/ImplicitDefaultTestSuite/TestDisabledHookNotInvoked/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestDisabledHookNotInvoked/MyTestCase.php index 97de006..aaf7ecb 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestDisabledHookNotInvoked/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestDisabledHookNotInvoked/MyTestCase.php @@ -4,11 +4,11 @@ use Amp\Future; use Amp\Success; -use Cspray\Labrador\AsyncUnit\Attribute\AfterEach; -use Cspray\Labrador\AsyncUnit\Attribute\BeforeEach; -use Cspray\Labrador\AsyncUnit\Attribute\Disabled; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\AfterEach; +use Labrador\AsyncUnit\Framework\Attribute\BeforeEach; +use Labrador\AsyncUnit\Framework\Attribute\Disabled; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { @@ -22,7 +22,7 @@ public function before() { #[Test] public function enabledTest() { $this->state[] = 'enabled'; - $this->asyncAssert()->arrayEquals(['before', 'enabled'], Future::complete($this->state)); + $this->assert->arrayEquals(['before', 'enabled'], $this->state); } #[Test] diff --git a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionDoesNotThrow/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionDoesNotThrow/MyTestCase.php index 5b5f334..e60cbc1 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionDoesNotThrow/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionDoesNotThrow/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestExpectsExceptionDoesNotThrow; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Exception\InvalidArgumentException; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Exception\InvalidArgumentException; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { @@ -12,7 +12,7 @@ class MyTestCase extends TestCase { public function checkDoesNotThrow() { $this->expect()->exception(InvalidArgumentException::class); - $this->assert()->isEmpty([]); + $this->assert->isEmpty([]); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionMessage/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionMessage/MyTestCase.php index d2a8da6..587bace 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionMessage/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionMessage/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestExpectsExceptionMessage; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Exception\InvalidArgumentException; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Exception\InvalidArgumentException; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionOnly/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionOnly/MyTestCase.php index 22cd68b..c7009f2 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionOnly/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionOnly/MyTestCase.php @@ -2,10 +2,10 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestExpectsExceptionOnly; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Exception\Exception; -use Cspray\Labrador\AsyncUnit\Exception\InvalidArgumentException; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Exception\Exception; +use Labrador\AsyncUnit\Framework\Exception\InvalidArgumentException; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionWrongMessage/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionWrongMessage/MyTestCase.php index 4d6ef45..af8f6cb 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionWrongMessage/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionWrongMessage/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestExpectsExceptionWrongMessage; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Exception\InvalidArgumentException; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Exception\InvalidArgumentException; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionWrongType/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionWrongType/MyTestCase.php index 361a712..aaa183b 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionWrongType/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestExpectsExceptionWrongType/MyTestCase.php @@ -2,10 +2,10 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestExpectsExceptionWrongType; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Exception\InvalidArgumentException; -use Cspray\Labrador\AsyncUnit\Exception\InvalidStateException; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Exception\InvalidArgumentException; +use Labrador\AsyncUnit\Framework\Exception\InvalidStateException; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAssertions/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAssertions/MyTestCase.php index 1ce077a..fff7707 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAssertions/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAssertions/MyTestCase.php @@ -2,8 +2,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestExpectsNoAssertions; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAssertionsAssertMade/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAssertionsAssertMade/MyTestCase.php index f7b49b9..c220a86 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAssertionsAssertMade/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAssertionsAssertMade/MyTestCase.php @@ -2,16 +2,16 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestExpectsNoAssertionsAssertMade; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function testNoAssertionAssertionMade() : void { $this->expect()->noAssertions(); - $this->assert()->isNull(null); - $this->assert()->isTrue(true); + $this->assert->isNull(null); + $this->assert->isTrue(true); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAsyncAssertionsAssertMade/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAsyncAssertionsAssertMade/MyTestCase.php deleted file mode 100644 index 0a4dd95..0000000 --- a/acme_src/ImplicitDefaultTestSuite/TestExpectsNoAsyncAssertionsAssertMade/MyTestCase.php +++ /dev/null @@ -1,19 +0,0 @@ -expect()->noAssertions(); - - $this->asyncAssert()->isNull(Future::complete(null)); - $this->asyncAssert()->isEmpty(Future::complete([])); - } - -} \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/TestFailedExceptionThrowingTest/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestFailedExceptionThrowingTest/MyTestCase.php index 16daaa2..2c6ef1e 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestFailedExceptionThrowingTest/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestFailedExceptionThrowingTest/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestFailedExceptionThrowingTest; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Exception\TestFailedException; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Exception\TestFailedException; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/TestHasOutput/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestHasOutput/MyTestCase.php index 2005e93..5e6eed2 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestHasOutput/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestHasOutput/MyTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestHasOutput; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { #[Test] public function testProducesOutput() { - $this->assert()->stringEquals('something', 'something'); + $this->assert->stringEquals('something', 'something'); echo __FUNCTION__; } diff --git a/acme_src/ImplicitDefaultTestSuite/TestHasTimeout/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestHasTimeout/MyTestCase.php index 01764cf..7badc57 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestHasTimeout/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestHasTimeout/MyTestCase.php @@ -2,9 +2,9 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestHasTimeout; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\Attribute\Timeout; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\Attribute\Timeout; +use Labrador\AsyncUnit\Framework\TestCase; use function Amp\delay; class MyTestCase extends TestCase { @@ -13,7 +13,7 @@ class MyTestCase extends TestCase { #[Timeout(100)] public function timeOutTest() : void { delay(0.500); - $this->assert()->stringEquals('a', 'a'); + $this->assert->stringEquals('a', 'a'); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/TestKnownRunTime/MyTestCase.php b/acme_src/ImplicitDefaultTestSuite/TestKnownRunTime/MyTestCase.php index 8e79543..d879232 100644 --- a/acme_src/ImplicitDefaultTestSuite/TestKnownRunTime/MyTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/TestKnownRunTime/MyTestCase.php @@ -3,8 +3,8 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\TestKnownRunTime; use Amp\Future; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class MyTestCase extends TestCase { diff --git a/acme_src/ImplicitDefaultTestSuite/WithAsyncUnitConfig/tests/Bar/FooTestCase.php b/acme_src/ImplicitDefaultTestSuite/WithAsyncUnitConfig/tests/Bar/FooTestCase.php index adde7a7..ce65f9e 100644 --- a/acme_src/ImplicitDefaultTestSuite/WithAsyncUnitConfig/tests/Bar/FooTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/WithAsyncUnitConfig/tests/Bar/FooTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\WithAsyncUnitConfig\tests\Bar; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class FooTestCase extends TestCase { #[Test] public function testIntEquals() { - $this->assert()->intEquals(1, 1); + $this->assert->intEquals(1, 1); } } \ No newline at end of file diff --git a/acme_src/ImplicitDefaultTestSuite/WithAsyncUnitConfig/tests/Foo/BarTestCase.php b/acme_src/ImplicitDefaultTestSuite/WithAsyncUnitConfig/tests/Foo/BarTestCase.php index fb43ab0..a1bfb34 100644 --- a/acme_src/ImplicitDefaultTestSuite/WithAsyncUnitConfig/tests/Foo/BarTestCase.php +++ b/acme_src/ImplicitDefaultTestSuite/WithAsyncUnitConfig/tests/Foo/BarTestCase.php @@ -2,14 +2,14 @@ namespace Acme\DemoSuites\ImplicitDefaultTestSuite\WithAsyncUnitConfig\tests\Foo; -use Cspray\Labrador\AsyncUnit\Attribute\Test; -use Cspray\Labrador\AsyncUnit\TestCase; +use Labrador\AsyncUnit\Framework\Attribute\Test; +use Labrador\AsyncUnit\Framework\TestCase; class BarTestCase extends TestCase { #[Test] public function ensureStringEquals() { - $this->assert()->not()->stringEquals('foo', 'bar'); + $this->assert->not()->stringEquals('foo', 'bar'); } } \ No newline at end of file diff --git a/composer.json b/composer.json index 06c8838..5ee8776 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "cspray/labrador-async-unit", + "name": "labrador-kennel/async-unit", "description": "An async unit and integration testing framework written on top of PHP8", "bin": [ "bin/asyncunit" @@ -9,7 +9,7 @@ "amphp/amp": "^3", "amphp/byte-stream": "^v2.0", "amphp/file": "^3.0", - "cspray/labrador-async-event": "^3.0", + "labrador-kennel/async-event": "^4.0", "cspray/labrador-styled-byte-stream": "^0.2", "opis/json-schema": "^2.0", "nikic/php-parser": "^4.10", @@ -24,14 +24,12 @@ }, "autoload": { "psr-4": { - "Cspray\\Labrador\\AsyncUnit\\": "framework_src", - "Cspray\\Labrador\\AsyncUnitCli\\": "cli_src" + "Labrador\\AsyncUnit\\": "src" } }, "autoload-dev": { "psr-4": { - "Cspray\\Labrador\\AsyncUnit\\": "framework_test", - "Cspray\\Labrador\\AsyncUnitCli\\": "cli_test", + "Labrador\\AsyncUnit\\Test\\": "tests", "Acme\\DemoSuites\\": "acme_src", "Acme\\Examples\\SimpleEquals\\": "examples/simple_equals_src", "Acme\\Examples\\CustomAssertion\\": "examples/custom_assertion_src", diff --git a/composer.lock b/composer.lock index a321e41..6f6a212 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5784a0924112bc9c92a881922b04d360", + "content-hash": "648a8c8eae00cec3d0787d98549b69a5", "packages": [ { "name": "amphp/amp", @@ -950,63 +950,6 @@ ], "time": "2024-01-30T23:01:51+00:00" }, - { - "name": "cspray/labrador-async-event", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/labrador-kennel/async-event.git", - "reference": "786c9cf4194170b34a01b32975ae0ef87e506516" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/labrador-kennel/async-event/zipball/786c9cf4194170b34a01b32975ae0ef87e506516", - "reference": "786c9cf4194170b34a01b32975ae0ef87e506516", - "shasum": "" - }, - "require": { - "amphp/amp": "~v3.0", - "labrador-kennel/composite-future": "^1.2", - "php": "^8.1" - }, - "require-dev": { - "amphp/phpunit-util": "~v3.0", - "cspray/labrador-coding-standard": "0.2.0", - "phpunit/phpunit": "^9.5", - "psalm/phar": "^5.6", - "roave/security-advisories": "dev-latest" - }, - "type": "library", - "autoload": { - "psr-4": { - "Labrador\\AsyncEvent\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Charles Sprayberry", - "email": "contact@labrador-kennel.io", - "homepage": "https://labrador-kennel.io", - "role": "Project Maintainer" - } - ], - "description": "Trigger semantic application events powered by Amp Event Loop", - "keywords": [ - "amphp", - "event-emitter", - "labrador-kennel" - ], - "support": { - "issues": "https://github.com/labrador-kennel/async-event/issues", - "source": "https://github.com/labrador-kennel/async-event/tree/3.0.0" - }, - "abandoned": "labrador-kennel/async-event", - "time": "2023-04-23T11:43:48+00:00" - }, { "name": "cspray/labrador-styled-byte-stream", "version": "0.2.0", @@ -1156,6 +1099,66 @@ }, "time": "2023-02-03T21:26:53+00:00" }, + { + "name": "labrador-kennel/async-event", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/labrador-kennel/async-event.git", + "reference": "932791a3d49990e0d56addf696dcc56d00f569a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/labrador-kennel/async-event/zipball/932791a3d49990e0d56addf696dcc56d00f569a3", + "reference": "932791a3d49990e0d56addf696dcc56d00f569a3", + "shasum": "" + }, + "require": { + "amphp/amp": "~v3.0", + "labrador-kennel/composite-future": "^1.2", + "php": "^8.2" + }, + "require-dev": { + "amphp/phpunit-util": "dev-phpunit-10-support", + "cspray/labrador-coding-standard": "0.2.0", + "mockery/mockery": "^1.6", + "phpunit/phpunit": "^10", + "psalm/phar": "^5.6", + "roave/security-advisories": "dev-latest" + }, + "suggest": { + "labrador-kennel/async-event-autowire": "If using cspray/annotated-container will allow you to automatically register Listener implementations into your Emitter." + }, + "type": "library", + "autoload": { + "psr-4": { + "Labrador\\AsyncEvent\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Charles Sprayberry", + "email": "contact@labrador-kennel.io", + "homepage": "https://labrador-kennel.io", + "role": "Project Maintainer" + } + ], + "description": "Trigger semantic application events powered by Amp Event Loop", + "keywords": [ + "amphp", + "event-emitter", + "labrador-kennel" + ], + "support": { + "issues": "https://github.com/labrador-kennel/async-event/issues", + "source": "https://github.com/labrador-kennel/async-event/tree/v4.0.0" + }, + "time": "2024-05-30T19:39:47+00:00" + }, { "name": "labrador-kennel/composite-future", "version": "1.3.0", diff --git a/framework_src/Assertion/AbstractAsyncAssertion.php b/framework_src/Assertion/AbstractAsyncAssertion.php deleted file mode 100644 index f4ad6a3..0000000 --- a/framework_src/Assertion/AbstractAsyncAssertion.php +++ /dev/null @@ -1,27 +0,0 @@ -actual instanceof Future) { - $actual = $this->actual->await(); - } else { - $actual = async(fn() => yield $this->actual)->await(); - } - return $this->getAssertion($actual)->assert(); - }); - } - - abstract protected function getAssertion(mixed $resolvedActual) : Assertion; -} \ No newline at end of file diff --git a/framework_src/Assertion/AsyncAssertArrayEquals.php b/framework_src/Assertion/AsyncAssertArrayEquals.php deleted file mode 100644 index d9d03e3..0000000 --- a/framework_src/Assertion/AsyncAssertArrayEquals.php +++ /dev/null @@ -1,21 +0,0 @@ -expected, $resolvedActual); - } -} \ No newline at end of file diff --git a/framework_src/Assertion/AsyncAssertCountEquals.php b/framework_src/Assertion/AsyncAssertCountEquals.php deleted file mode 100644 index 1990efe..0000000 --- a/framework_src/Assertion/AsyncAssertCountEquals.php +++ /dev/null @@ -1,20 +0,0 @@ -expected, $resolvedActual); - } -} \ No newline at end of file diff --git a/framework_src/Assertion/AsyncAssertFloatEquals.php b/framework_src/Assertion/AsyncAssertFloatEquals.php deleted file mode 100644 index 0b2a3b3..0000000 --- a/framework_src/Assertion/AsyncAssertFloatEquals.php +++ /dev/null @@ -1,20 +0,0 @@ -expected, $actual); - } -} \ No newline at end of file diff --git a/framework_src/Assertion/AsyncAssertInstanceOf.php b/framework_src/Assertion/AsyncAssertInstanceOf.php deleted file mode 100644 index 3c9c2e4..0000000 --- a/framework_src/Assertion/AsyncAssertInstanceOf.php +++ /dev/null @@ -1,28 +0,0 @@ -expected, $resolvedActual); - } -} \ No newline at end of file diff --git a/framework_src/Assertion/AsyncAssertIntEquals.php b/framework_src/Assertion/AsyncAssertIntEquals.php deleted file mode 100644 index 74062b3..0000000 --- a/framework_src/Assertion/AsyncAssertIntEquals.php +++ /dev/null @@ -1,20 +0,0 @@ -expected, $actual); - } -} \ No newline at end of file diff --git a/framework_src/Assertion/AsyncAssertIsEmpty.php b/framework_src/Assertion/AsyncAssertIsEmpty.php deleted file mode 100644 index e87a0fa..0000000 --- a/framework_src/Assertion/AsyncAssertIsEmpty.php +++ /dev/null @@ -1,14 +0,0 @@ -expected, $resolvedActual); - } -} \ No newline at end of file diff --git a/framework_src/AsyncAssertion.php b/framework_src/AsyncAssertion.php deleted file mode 100644 index ea14fec..0000000 --- a/framework_src/AsyncAssertion.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ - public function assert() : Future; - -} \ No newline at end of file diff --git a/framework_src/Context/AssertionContext.php b/framework_src/Context/AssertionContext.php deleted file mode 100644 index af6e0ff..0000000 --- a/framework_src/Context/AssertionContext.php +++ /dev/null @@ -1,142 +0,0 @@ -count += $assertionCount; - } - - public function arrayEquals(array $expected, array $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $assert = new AssertArrayEquals($expected, $actual); - $results = $assert->assert(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function floatEquals(float $expected, float $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $assert = new AssertFloatEquals($expected, $actual); - $results = $assert->assert(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function intEquals(int $expected, int $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $assert = new AssertIntEquals($expected, $actual); - $results = $assert->assert(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function stringEquals(string $expected, string $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $assert = new AssertStringEquals($expected, $actual); - $results = $assert->assert(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function countEquals(int $expected, array|Countable $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $assert = new AssertCountEquals($expected, $actual); - $results = $assert->assert(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function instanceOf(string|object $expected, object $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - $assert = new AssertInstanceOf($expected, $actual); - $results = $assert->assert(); - $this->handleAssertionResults($results, $isNot, $message); - } - - public function isEmpty(mixed $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $assert = new AssertIsEmpty($actual); - $results = $assert->assert(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function isTrue(bool $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $assert = new AssertIsTrue($actual); - $results = $assert->assert(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function isFalse(bool $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $assert = new AssertIsFalse($actual); - $results = $assert->assert(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function isNull(mixed $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $assert = new AssertIsNull($actual); - $results = $assert->assert(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function __call(string $methodName, array $args) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $results = $this->customAssertionContext->createAssertion($methodName, ...$args)->assert(); - - $this->handleAssertionResults($results, $isNot, null); - } - -} \ No newline at end of file diff --git a/framework_src/Context/AsyncAssertionContext.php b/framework_src/Context/AsyncAssertionContext.php deleted file mode 100644 index c4e803c..0000000 --- a/framework_src/Context/AsyncAssertionContext.php +++ /dev/null @@ -1,115 +0,0 @@ -isNot; - $this->invokedAssertionContext(); - - $results = (new AsyncAssertArrayEquals($expected, $actual))->assert()->await(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function floatEquals(float $expected, Future|Generator $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $results = (new AsyncAssertFloatEquals($expected, $actual))->assert()->await(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - public function intEquals(int $expected, Future|Generator $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - - $results = (new AsyncAssertIntEquals($expected, $actual))->assert()->await(); - - $this->handleAssertionResults($results, $isNot, $message); - } - - /** - * Compare that an $actual string resolved from a promisor is equal to $expected. - * - * @param string $expected - * @param Future|Generator $actual - * @param string|null $message - */ - public function stringEquals(string $expected, Future|Generator $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - $results = (new AsyncAssertStringEquals($expected, $actual))->assert()->await(); - $this->handleAssertionResults($results, $isNot, $message); - } - - public function countEquals(int $expected, Future|Generator $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - $results = (new AsyncAssertCountEquals($expected, $actual))->assert()->await(); - $this->handleAssertionResults($results, $isNot, $message); - } - - public function instanceOf(string $expected, Future|Generator $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - $results = (new AsyncAssertInstanceOf($expected, $actual))->assert()->await(); - $this->handleAssertionResults($results, $isNot, $message); - } - - public function isTrue(Future|Generator $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - $results = (new AsyncAssertIsTrue($actual))->assert()->await(); - $this->handleAssertionResults($results, $isNot, $message); - } - - public function isFalse(Future|Generator $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - $results = (new AsyncAssertIsFalse($actual))->assert()->await(); - $this->handleAssertionResults($results, $isNot, $message); - } - - public function isNull(Future|Generator $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - $results = (new AsyncAssertIsNull($actual))->assert()->await(); - $this->handleAssertionResults($results, $isNot, $message); - } - - public function isEmpty(Future|Generator $actual, string $message = null) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - $results = (new AsyncAssertIsEmpty($actual))->assert()->await(); - $this->handleAssertionResults($results, $isNot, $message); - } - - public function __call(string $methodName, array $args) : void { - $isNot = $this->isNot; - $this->invokedAssertionContext(); - $results = $this->customAssertionContext->createAsyncAssertion($methodName, ...$args)->assert()->await(); - $this->handleAssertionResults($results, $isNot, null); - } -} \ No newline at end of file diff --git a/framework_src/Context/LastAssertionCalledTrait.php b/framework_src/Context/LastAssertionCalledTrait.php deleted file mode 100644 index 31090bc..0000000 --- a/framework_src/Context/LastAssertionCalledTrait.php +++ /dev/null @@ -1,30 +0,0 @@ -lastAssertionFile = $file; - } - - public function getLastAssertionFile() : ?string { - return $this->lastAssertionFile; - } - - public function setLastAssertionLine(int $line) : void { - $this->lastAssertionLine = $line; - } - - public function getLastAssertionLine() : int { - return $this->lastAssertionLine; - } - -} \ No newline at end of file diff --git a/framework_src/Context/SharedAssertionContextTrait.php b/framework_src/Context/SharedAssertionContextTrait.php deleted file mode 100644 index 2bf48c5..0000000 --- a/framework_src/Context/SharedAssertionContextTrait.php +++ /dev/null @@ -1,43 +0,0 @@ -count; - } - - public function not() : self { - $this->isNot = true; - return $this; - } - - private function getDefaultFailureMessage(string $assertionString) : string { - return sprintf("Failed %s", $assertionString); - } - - private function invokedAssertionContext() : void { - $this->count++; - $this->isNot = false; - } - - private function handleAssertionResults(AssertionResult $result, bool $isNot, ?string $customMessage) { - if (($isNot && $result->isSuccessful()) || (!$isNot && !$result->isSuccessful())) { - throw new AssertionFailedException( - $customMessage ?? $this->getDefaultFailureMessage($isNot ? $result->getSummary()->toNotString() : $result->getSummary()->toString()), - $this->getDefaultFailureMessage($isNot ? $result->getDetails()->toNotString() : $result->getDetails()->toString()), - $this->getLastAssertionFile(), - $this->getLastAssertionLine() - ); - } - } - -} \ No newline at end of file diff --git a/framework_src/Event/ProcessingFinishedEvent.php b/framework_src/Event/ProcessingFinishedEvent.php deleted file mode 100644 index 2f57eec..0000000 --- a/framework_src/Event/ProcessingFinishedEvent.php +++ /dev/null @@ -1,21 +0,0 @@ -testSuite; - } - - final public function getAssertionCount() : int { - return $this->assertionContext->getAssertionCount(); - } - - final public function getAsyncAssertionCount() : int { - return $this->asyncAssertionContext->getAssertionCount(); - } - - final protected function assert() : AssertionContext { - return $this->setAssertionFileAndLine($this->assertionContext, __FUNCTION__, debug_backtrace(10)); - } - - final protected function asyncAssert() : AsyncAssertionContext { - return $this->setAssertionFileAndLine($this->asyncAssertionContext, __FUNCTION__, debug_backtrace(10)); - } - - final protected function expect() : TestExpector { - return $this->expectationContext; - } - - final public function mocks() : MockBridge { - if (is_null($this->testMocker)) { - $msg = 'Attempted to create a mock but no MockBridge was defined. Please ensure you\'ve configured a mockBridge in your configuration.'; - throw new InvalidStateException($msg); - } - - return $this->testMocker; - } - - private function setAssertionFileAndLine(AssertionContext|AsyncAssertionContext $context, string $method, array $backtrace) : AssertionContext|AsyncAssertionContext { - foreach ($backtrace as $trace) { - if (!isset($trace['class']) && !isset($trace['function'])) { - continue; - } - if ($trace['class'] === self::class && $trace['function'] === $method) { - $context->setLastAssertionFile($trace['file']); - $context->setLastAssertionLine($trace['line']); - break; - } - } - return $context; - } - -} \ No newline at end of file diff --git a/framework_test/Assertion/AsyncAssertArrayEqualsTest.php b/framework_test/Assertion/AsyncAssertArrayEqualsTest.php deleted file mode 100644 index 527393d..0000000 --- a/framework_test/Assertion/AsyncAssertArrayEqualsTest.php +++ /dev/null @@ -1,45 +0,0 @@ -expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( - 'The expected value must be a valid class but %s was given', var_export('not a class', true) - )); - new AsyncAssertInstanceOf('not a class', Future::complete(new \stdClass())); - } - - public function testInstanceOfInterfaceIsValid() { - $subject = new AsyncAssertInstanceOf(AssertionMessage::class, Future::complete(new TrueUnaryOperandSummary('something'))); - $results = $subject->assert()->await(); - - $this->assertTrue($results->isSuccessful()); - $this->assertInstanceOf(InstanceOfMessage::class, $results->getSummary()); - $this->assertInstanceOf(InstanceOfMessage::class, $results->getDetails()); - } - - public function testInstanceOfTypeIsNotInstance() { - $subject = new AsyncAssertInstanceOf(TestCase::class, Future::complete(new TrueUnaryOperandSummary('foo'))); - $results = $subject->assert()->await(); - - $this->assertFalse($results->isSuccessful()); - $this->assertInstanceOf(InstanceOfMessage::class, $results->getSummary()); - $this->assertInstanceOf(InstanceOfMessage::class, $results->getDetails()); - } - - public function testPassingObjectAsExpected() { - $subject = new AsyncAssertInstanceOf(new InvalidStateException(), Future::complete(new InvalidArgumentException())); - $results = $subject->assert()->await(); - - $this->assertFalse($results->isSuccessful()); - $this->assertInstanceOf(InstanceOfMessage::class, $results->getSummary()); - $this->assertInstanceOf(InstanceOfMessage::class, $results->getDetails()); - } - -} \ No newline at end of file diff --git a/framework_test/Assertion/AsyncAssertIntEqualsTest.php b/framework_test/Assertion/AsyncAssertIntEqualsTest.php deleted file mode 100644 index 61594f4..0000000 --- a/framework_test/Assertion/AsyncAssertIntEqualsTest.php +++ /dev/null @@ -1,45 +0,0 @@ -subject = $reflectedClass->newInstanceWithoutConstructor(); - } - - public function testHasAssertionContextFalseIfEmpty() { - $this->assertFalse($this->subject->hasRegisteredAssertion('someMethodName')); - } - - public function testHasAsyncAssertionContextFalseIfEmpty() { - $this->assertFalse($this->subject->hasRegisteredAsyncAssertion('someMethodName')); - } - - public function testRegisterAssertionWithInvalidName() { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A registered custom assertion must have a valid method name but "bad value with spaces" was provided'); - - $this->subject->registerAssertion('bad value with spaces', function() {}); - } - - public function testRegisterAsyncAssertionWithInvalidName() { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A registered custom async assertion must have a valid method name but "bad value with spaces" was provided'); - - $this->subject->registerAsyncAssertion('bad value with spaces', function() {}); - } - - public function testRegisterAssertionHasAssertionReturnsTrue() { - $this->subject->registerAssertion('ensureCustomThing', function() {}); - - $this->assertTrue($this->subject->hasRegisteredAssertion('ensureCustomThing')); - } - - public function testRegisterAsyncAssertionHasAssertionReturnsTrue() { - $this->subject->registerAsyncAssertion('ensureSomeThing', function() {}); - - $this->assertTrue($this->subject->hasRegisteredAsyncAssertion('ensureSomeThing')); - } - - public function testCreateAssertionDoesNotExistThrowsException() { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('There is no custom assertion registered for "customAssertionName".'); - - $this->subject->createAssertion('customAssertionName'); - } - - public function testCreateAsyncAssertionDoesNotExistThrowsException() { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('There is no custom async assertion registered for "customAssertionName".'); - - $this->subject->createAsyncAssertion('customAssertionName'); - } - - public function testCreateRegisteredFactoryDoesNotReturnAssertionThrowsException() { - $this->subject->registerAssertion('ensureSomething', fn() => 'not an assertion'); - - $this->expectException(InvalidStateException::class); - $this->expectExceptionMessage('The factory for custom assertion "ensureSomething" must return an instance of ' . Assertion::class); - - $this->subject->createAssertion('ensureSomething'); - } - - public function testCreateRegisteredFactoryDoesNotReturnAsyncAssertionThrowsException() { - $this->subject->registerAsyncAssertion('ensureSomething', fn() => 'not an assertion'); - - $this->expectException(InvalidStateException::class); - $this->expectExceptionMessage('The factory for custom async assertion "ensureSomething" must return an instance of ' . AsyncAssertion::class); - - $this->subject->createAsyncAssertion('ensureSomething'); - } - - public function testCreateRegisteredFactoryIsAssertionReturnsObject() { - $assertion = $this->getMockBuilder(Assertion::class)->getMock(); - $this->subject->registerAssertion('ensureSomething', fn() => $assertion); - - $actual = $this->subject->createAssertion('ensureSomething'); - - $this->assertSame($assertion, $actual); - } - - public function testCreateRegisteredFactoryIsAsyncAssertionReturnsObject() { - $assertion = $this->getMockBuilder(AsyncAssertion::class)->getMock(); - $this->subject->registerAsyncAssertion('ensureSomething', fn() => $assertion); - - $actual = $this->subject->createAsyncAssertion('ensureSomething'); - - $this->assertSame($assertion, $actual); - } - - public function testRegisteredAssertionFactoryReceivesArgs() { - $assertion = $this->getMockBuilder(Assertion::class)->getMock(); - $state = new \stdClass(); - $state->args = null; - $this->subject->registerAssertion('ensureSomething', function(...$args) use($state, $assertion) { - $state->args = $args; - return $assertion; - }); - - $this->subject->createAssertion('ensureSomething', 1, 'a', 'b', ['1', '2', 3]); - $this->assertNotNull($state->args); - $this->assertSame([1, 'a', 'b', ['1', '2', 3]], $state->args); - } - - public function testRegisteredAsyncAssertionFactoryReceivesArgs() { - $assertion = $this->getMockBuilder(AsyncAssertion::class)->getMock(); - $state = new \stdClass(); - $state->args = null; - $this->subject->registerAsyncAssertion('ensureSomething', function(...$args) use($state, $assertion) { - $state->args = $args; - return $assertion; - }); - - $this->subject->createAsyncAssertion('ensureSomething', 1, 'a', 'b', ['1', '2', 3]); - $this->assertNotNull($state->args); - $this->assertSame([1, 'a', 'b', ['1', '2', 3]], $state->args); - } -} \ No newline at end of file diff --git a/framework_test/MockBridge/MockeryMockBridgeTest.php b/framework_test/MockBridge/MockeryMockBridgeTest.php deleted file mode 100644 index f385b38..0000000 --- a/framework_test/MockBridge/MockeryMockBridgeTest.php +++ /dev/null @@ -1,42 +0,0 @@ -markTestSkipped('Need to reimplement Application replacement'); - $subject = new MockeryMockBridge(); - - $subject->initialize(); - $mock = $subject->createMock(Application::class); - - $mock->expects()->start()->andReturn(new Success()); - - $this->expectException(MockFailureException::class); - - $subject->finalize(); - } - - public function testMockWithGoodPredictions() : void { - $this->markTestSkipped('Need to reimplement Application replacement'); - $this->expectNotToPerformAssertions(); - $subject = new MockeryMockBridge(); - - $subject->initialize(); - $mock = $subject->createMock(Application::class); - $mock->expects()->start()->andReturn(new Success()); - - $mock->start(); - - $subject->finalize(); - } - -} \ No newline at end of file diff --git a/framework_test/MockBridge/ProphecyMockBridgeTest.php b/framework_test/MockBridge/ProphecyMockBridgeTest.php deleted file mode 100644 index bda94b2..0000000 --- a/framework_test/MockBridge/ProphecyMockBridgeTest.php +++ /dev/null @@ -1,56 +0,0 @@ -markTestSkipped('Need to reimplement Application replacement'); - $subject = new ProphecyMockBridge(); - - $subject->initialize(); - $mock = $subject->createMock(Application::class); - - $mock->start()->shouldBeCalled()->willReturn(new Success()); - - $this->expectException(MockFailureException::class); - - $subject->finalize(); - } - - public function testMockWithGoodPredictions() { - $this->markTestSkipped('Need to reimplement Application replacement'); - $this->expectNotToPerformAssertions(); - $subject = new ProphecyMockBridge(); - - $subject->initialize(); - $mock = $subject->createMock(Application::class); - - $mock->start()->shouldBeCalled()->willReturn(new Success()); - - $mock->reveal()->start(); - - $subject->finalize(); - } - - public function testMockAssertionCount() { - $this->markTestSkipped('Need to reimplement Application replacement'); - $subject = new ProphecyMockBridge(); - - $subject->initialize(); - $mock = $subject->createMock(Application::class); - - $mock->start()->shouldBeCalled()->willReturn(new Success()); - - $secondMock = $subject->createMock(Application::class); - $secondMock->start()->shouldBeCalled()->willReturn(new Success()); - - $this->assertSame(2, $subject->getAssertionCount()); - } - -} \ No newline at end of file diff --git a/framework_test/Resources/dummy_configs/has_mock_bridge.json b/framework_test/Resources/dummy_configs/has_mock_bridge.json deleted file mode 100644 index 66a9700..0000000 --- a/framework_test/Resources/dummy_configs/has_mock_bridge.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "testDirs": ["."], - "resultPrinter": "Cspray\\Labrador\\AsyncUnitCli\\DefaultResultPrinter", - "mockBridge": "Cspray\\Labrador\\AsyncUnit\\MockBridge\\MockeryMockBridge" -} diff --git a/framework_test/Resources/dummy_configs/has_plugins.json b/framework_test/Resources/dummy_configs/has_plugins.json deleted file mode 100644 index 7b7b1ad..0000000 --- a/framework_test/Resources/dummy_configs/has_plugins.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "testDirs": ["."], - "resultPrinter": "Cspray\\Labrador\\AsyncUnitCli\\DefaultResultPrinter", - "plugins": ["FooBar"] -} \ No newline at end of file diff --git a/framework_test/Resources/dummy_configs/minimally_valid.json b/framework_test/Resources/dummy_configs/minimally_valid.json deleted file mode 100644 index 8b0eaa5..0000000 --- a/framework_test/Resources/dummy_configs/minimally_valid.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "testDirs": ["."], - "resultPrinter": "Cspray\\Labrador\\AsyncUnitCli\\TerminalResultPrinter", - "mockBridge": "Cspray\\Labrador\\AsyncUnit\\Stub\\MockBridgeStub" -} \ No newline at end of file diff --git a/framework_test/Stub/AssertNotTestCase.php b/framework_test/Stub/AssertNotTestCase.php deleted file mode 100644 index 7db0116..0000000 --- a/framework_test/Stub/AssertNotTestCase.php +++ /dev/null @@ -1,28 +0,0 @@ -assert()->not()->stringEquals('foo', 'bar'); - } - - public function doFailingNotAssertions() { - $this->assert()->not()->stringEquals('foo', 'foo'); - } - - public function doBothAssertions() { - $this->assert()->stringEquals('bar', 'bar'); - $this->assert()->not()->stringEquals('foo', 'bar'); - $this->assert()->stringEquals('foo', 'foo'); - } - - public function doAsyncNotAssertion() { - $this->asyncAssert()->not()->intEquals(1, Future::complete(2)); - } - -} \ No newline at end of file diff --git a/framework_test/Stub/CustomAssertionTestCase.php b/framework_test/Stub/CustomAssertionTestCase.php deleted file mode 100644 index 9960cee..0000000 --- a/framework_test/Stub/CustomAssertionTestCase.php +++ /dev/null @@ -1,17 +0,0 @@ -assert()->myCustomAssertion(1, 2, 3); - } - - public function doCustomAsyncAssertion() { - $this->asyncAssert()->myCustomAssertion(1, 2, 3); - } - -} \ No newline at end of file diff --git a/framework_test/Stub/FailingTestCase.php b/framework_test/Stub/FailingTestCase.php deleted file mode 100644 index 940678e..0000000 --- a/framework_test/Stub/FailingTestCase.php +++ /dev/null @@ -1,22 +0,0 @@ -assert()->stringEquals('foo', 'bar'); - } - - public function doAsyncFailure() { - $this->asyncAssert()->stringEquals('foo', Future::complete('bar')); - } - - public function doFailureWithCustomMessage() { - $this->assert()->stringEquals('foo', 'bar', 'my custom message'); - } - -} \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index cc50317..9983269 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -14,16 +14,10 @@ colors="true"> - framework_test - cli_test - cli_test/Integration + tests/Unit - framework_test - - - cli_test - cli_test/Integration + tests/Unit/Framework diff --git a/cli_src/TerminalResultPrinter.php b/src/Cli/TerminalResultPrinter.php similarity index 56% rename from cli_src/TerminalResultPrinter.php rename to src/Cli/TerminalResultPrinter.php index 8b29e81..2304b90 100644 --- a/cli_src/TerminalResultPrinter.php +++ b/src/Cli/TerminalResultPrinter.php @@ -1,26 +1,23 @@ event === $eventName; - } - public function handle(Event $event) : Future|CompositeFuture|null { - ($this->closure)($this->output); + ($this->closure)($event, $this->output); return null; } }; } - public function registerEvents(EventEmitter $emitter, WritableStream $output) : void { + public function registerEvents(Emitter $emitter, WritableStream $output) : void { $output = new TerminalOutputStream($output); - $emitter->register(new OneTimeListener($this->createClosureInvokingListener( + $emitter->register( Events::PROCESSING_STARTED, - $output, - fn() => $this->testProcessingStarted($output) - ))); - $emitter->register($this->createClosureInvokingListener( + $this->createClosureInvokingListener($output, $this->testProcessingStarted(...)) + ); + $emitter->register( Events::TEST_PASSED, - $output, - fn() => $this->testPassed($output) - )); - $emitter->register($this->createClosureInvokingListener( + $this->createClosureInvokingListener($output, $this->testPassed(...)) + ); + $emitter->register( Events::TEST_FAILED, - $output, - fn(TestFailedEvent $event) => $this->testFailed($event, $output) - )); - $emitter->register($this->createClosureInvokingListener( + $this->createClosureInvokingListener($output, $this->testFailed(...)) + ); + $emitter->register( Events::TEST_DISABLED, - $output, - fn(TestDisabledEvent $event) => $this->testDisabled($event, $output) - )); - $emitter->register($this->createClosureInvokingListener( + $this->createClosureInvokingListener($output, $this->testDisabled(...)) + ); + $emitter->register( Events::TEST_ERRORED, - $output, - fn(TestErroredEvent $event) => $this->testErrored($event, $output) - )); - $emitter->register(new OneTimeListener($this->createClosureInvokingListener( + $this->createClosureInvokingListener($output, $this->testErrored(...)) + ); + $emitter->register( Events::PROCESSING_FINISHED, - $output, - fn(ProcessingFinishedEvent $event) => $this->testProcessingFinished($event, $output) - ))); + $this->createClosureInvokingListener($output, $this->testProcessingFinished(...)) + ); } - private function testProcessingStarted(WritableStream $output) : void { + private function testProcessingStarted(Event $_, WritableStream $output) : void { $inspirationalMessages = [ 'Let\'s run some asynchronous tests!', 'Zoom, zoom... here we go!', @@ -106,7 +92,7 @@ private function testProcessingStarted(WritableStream $output) : void { $output->write(sprintf("Runtime: PHP %s\n", phpversion())); } - private function testPassed(WritableStream $output) : void { + private function testPassed(Event $event, WritableStream $output) : void { $output->write('.'); } @@ -127,43 +113,43 @@ private function testErrored(TestErroredEvent $erroredEvent, WritableStream $out private function testProcessingFinished(ProcessingFinishedEvent $event, TerminalOutputStream $output) : void { $output->br(2); - $output->writeln((new ResourceUsageFormatter())->resourceUsage($event->getTarget()->getDuration())); + $output->writeln((new ResourceUsageFormatter())->resourceUsage($event->payload()->getDuration())); $output->br(); - if ($event->getTarget()->getErroredTestCount() > 0) { - $output->writeln(sprintf('There was %d error:', $event->getTarget()->getErroredTestCount())); + if ($event->payload()->getErroredTestCount() > 0) { + $output->writeln(sprintf('There was %d error:', $event->payload()->getErroredTestCount())); $output->br(); foreach ($this->erroredTests as $index => $erroredTestEvent) { $output->writeln(sprintf( '%d) %s::%s', $index + 1, - $erroredTestEvent->getTarget()->getTestCase()::class, - $erroredTestEvent->getTarget()->getTestMethod() + $erroredTestEvent->payload()->getTestCase()::class, + $erroredTestEvent->payload()->getTestMethod() )); - $output->writeln($erroredTestEvent->getTarget()->getException()->getMessage()); + $output->writeln($erroredTestEvent->payload()->getException()->getMessage()); $output->br(); - $output->writeln($erroredTestEvent->getTarget()->getException()->getTraceAsString()); + $output->writeln($erroredTestEvent->payload()->getException()->getTraceAsString()); } $output->br(); $output->writeln('ERRORS'); $output->writeln(sprintf( 'Tests: %d, Errors: %d, Assertions: %d, Async Assertions: %d', - $event->getTarget()->getTotalTestCount(), - $event->getTarget()->getErroredTestCount(), - $event->getTarget()->getAssertionCount(), - $event->getTarget()->getAsyncAssertionCount() + $event->payload()->getTotalTestCount(), + $event->payload()->getErroredTestCount(), + $event->payload()->getAssertionCount(), + $event->payload()->getAsyncAssertionCount() )); } - if ($event->getTarget()->getFailedTestCount() > 0) { - $output->writeln(sprintf("There was %d failure:\n", $event->getTarget()->getFailedTestCount())); + if ($event->payload()->getFailedTestCount() > 0) { + $output->writeln(sprintf("There was %d failure:\n", $event->payload()->getFailedTestCount())); foreach ($this->failedTests as $index => $failedTestEvent) { $output->writeln(sprintf( "%d) %s::%s", $index + 1, - $failedTestEvent->getTarget()->getTestCase()::class, - $failedTestEvent->getTarget()->getTestMethod() + $failedTestEvent->payload()->getTestCase()::class, + $failedTestEvent->payload()->getTestMethod() )); - $exception = $failedTestEvent->getTarget()->getException(); + $exception = $failedTestEvent->payload()->getException(); if ($exception instanceof AssertionFailedException) { $output->writeln($exception->getDetailedMessage()); $output->br(); @@ -199,41 +185,41 @@ private function testProcessingFinished(ProcessingFinishedEvent $event, Terminal $output->write("FAILURES\n"); $output->write(sprintf( "Tests: %d, Failures: %d, Assertions: %d, Async Assertions: %d\n", - $event->getTarget()->getTotalTestCount(), - $event->getTarget()->getFailedTestCount(), - $event->getTarget()->getAssertionCount(), - $event->getTarget()->getAsyncAssertionCount() + $event->payload()->getTotalTestCount(), + $event->payload()->getFailedTestCount(), + $event->payload()->getAssertionCount(), + $event->payload()->getAsyncAssertionCount() )); } - if ($event->getTarget()->getDisabledTestCount() > 0) { - $output->write(sprintf("There was %d disabled test:\n", $event->getTarget()->getDisabledTestCount())); + if ($event->payload()->getDisabledTestCount() > 0) { + $output->write(sprintf("There was %d disabled test:\n", $event->payload()->getDisabledTestCount())); $output->write("\n"); foreach ($this->disabledTests as $index => $disabledEvent) { $output->write(sprintf( "%d) %s::%s\n", $index + 1, - $disabledEvent->getTarget()->getTestCase()::class, - $disabledEvent->getTarget()->getTestMethod() + $disabledEvent->payload()->getTestCase()::class, + $disabledEvent->payload()->getTestMethod() )); } $output->write("\n"); $output->write(sprintf( "Tests: %d, Disabled Tests: %d, Assertions: %d, Async Assertions: %d\n", - $event->getTarget()->getTotalTestCount(), - $event->getTarget()->getDisabledTestCount(), - $event->getTarget()->getAssertionCount(), - $event->getTarget()->getAsyncAssertionCount() + $event->payload()->getTotalTestCount(), + $event->payload()->getDisabledTestCount(), + $event->payload()->getAssertionCount(), + $event->payload()->getAsyncAssertionCount() )); } - if ($event->getTarget()->getTotalTestCount() === $event->getTarget()->getPassedTestCount()) { + if ($event->payload()->getTotalTestCount() === $event->payload()->getPassedTestCount()) { $output->write("OK!\n"); $output->write(sprintf( "Tests: %d, Assertions: %d, Async Assertions: %d\n", - $event->getTarget()->getTotalTestCount(), - $event->getTarget()->getAssertionCount(), - $event->getTarget()->getAsyncAssertionCount() + $event->payload()->getTotalTestCount(), + $event->payload()->getAssertionCount(), + $event->payload()->getAsyncAssertionCount() )); } } diff --git a/framework_src/Assertion/AbstractAssertion.php b/src/Framework/Assertion/AbstractAssertion.php similarity index 79% rename from framework_src/Assertion/AbstractAssertion.php rename to src/Framework/Assertion/AbstractAssertion.php index 936083d..87f0e02 100644 --- a/framework_src/Assertion/AbstractAssertion.php +++ b/src/Framework/Assertion/AbstractAssertion.php @@ -1,10 +1,6 @@ expected, $this->actual); + return new CountEqualsMessage($this->expected, $this->actual); } private function getDetails() : AssertionMessage { - return new Assertion\AssertionMessage\CountEqualsMessage($this->expected, $this->actual); + return new CountEqualsMessage($this->expected, $this->actual); } } \ No newline at end of file diff --git a/framework_src/Assertion/AssertFloatEquals.php b/src/Framework/Assertion/AssertFloatEquals.php similarity index 55% rename from framework_src/Assertion/AssertFloatEquals.php rename to src/Framework/Assertion/AssertFloatEquals.php index 0be681f..424e679 100644 --- a/framework_src/Assertion/AssertFloatEquals.php +++ b/src/Framework/Assertion/AssertFloatEquals.php @@ -1,10 +1,9 @@ getExpected(), $this->getActual()); + return new BinaryOperandDetails($this->getExpected(), $this->getActual()); } } \ No newline at end of file diff --git a/framework_src/Assertion/AssertInstanceOf.php b/src/Framework/Assertion/AssertInstanceOf.php similarity index 75% rename from framework_src/Assertion/AssertInstanceOf.php rename to src/Framework/Assertion/AssertInstanceOf.php index 2efb574..de5fa58 100644 --- a/framework_src/Assertion/AssertInstanceOf.php +++ b/src/Framework/Assertion/AssertInstanceOf.php @@ -1,10 +1,9 @@ expected, $this->actual); + $message = new InstanceOfMessage($this->expected, $this->actual); if ($this->actual instanceof $this->expected) { return AssertionResultFactory::validAssertion($message, $message); } diff --git a/framework_src/Assertion/AssertIntEquals.php b/src/Framework/Assertion/AssertIntEquals.php similarity index 55% rename from framework_src/Assertion/AssertIntEquals.php rename to src/Framework/Assertion/AssertIntEquals.php index c7f4faa..5429b15 100644 --- a/framework_src/Assertion/AssertIntEquals.php +++ b/src/Framework/Assertion/AssertIntEquals.php @@ -1,10 +1,9 @@ getExpected(), $this->getActual()); + return new BinaryOperandDetails($this->getExpected(), $this->getActual()); } } \ No newline at end of file diff --git a/framework_src/Assertion/AssertIsEmpty.php b/src/Framework/Assertion/AssertIsEmpty.php similarity index 51% rename from framework_src/Assertion/AssertIsEmpty.php rename to src/Framework/Assertion/AssertIsEmpty.php index 0706eb4..5a9549e 100644 --- a/framework_src/Assertion/AssertIsEmpty.php +++ b/src/Framework/Assertion/AssertIsEmpty.php @@ -1,9 +1,9 @@ actual) ? 'validAssertion' : 'invalidAssertion'; return AssertionResultFactory::$factoryMethod( - new Assertion\AssertionMessage\EmptyUnaryOperandSummary($this->actual), - new Assertion\AssertionMessage\EmptyUnaryOperandDetails($this->actual) + new EmptyUnaryOperandSummary($this->actual), + new EmptyUnaryOperandDetails($this->actual) ); } } \ No newline at end of file diff --git a/framework_src/Assertion/AssertIsFalse.php b/src/Framework/Assertion/AssertIsFalse.php similarity index 60% rename from framework_src/Assertion/AssertIsFalse.php rename to src/Framework/Assertion/AssertIsFalse.php index 0c38887..21b9ca7 100644 --- a/framework_src/Assertion/AssertIsFalse.php +++ b/src/Framework/Assertion/AssertIsFalse.php @@ -1,11 +1,9 @@ registerFile( 'https://labrador-kennel.io/dev/async-unit/schema/cli-config.json', - dirname(__DIR__) . '/resources/schema/cli-config.json' + dirname(__DIR__, 3) . '/resources/schema/cli-config.json' ); $schema = $this->validator->loader()->loadSchemaById( Uri::parse('https://labrador-kennel.io/dev/async-unit/schema/cli-config.json') @@ -45,7 +43,7 @@ public function make(string $configFile) : Configuration { 'The JSON file at "%s" does not adhere to the JSON Schema https://labrador-kennel.io/dev/async-unit/schema/cli-config.json', $configFile ); - throw new InvalidConfigurationException($results->error()->message()); + throw new InvalidConfigurationException($msg); } $absoluteTestDirs = []; diff --git a/src/Framework/Context/AssertionContext.php b/src/Framework/Context/AssertionContext.php new file mode 100644 index 0000000..3c6e41a --- /dev/null +++ b/src/Framework/Context/AssertionContext.php @@ -0,0 +1,122 @@ +count += $assertionCount; + } + + public function arrayEquals(array $expected, array $actual, string $message = null) : void { + $this->doAssertion(new AssertArrayEquals($expected, $actual), $message); + } + + public function floatEquals(float $expected, float $actual, string $message = null) : void { + $this->doAssertion(new AssertFloatEquals($expected, $actual), $message); + } + + public function intEquals(int $expected, int $actual, string $message = null) : void { + $this->doAssertion(new AssertIntEquals($expected, $actual), $message); + } + + public function stringEquals(string $expected, string $actual, string $message = null) : void { + $this->doAssertion(new AssertStringEquals($expected, $actual), $message); + } + + public function countEquals(int $expected, array|Countable $actual, string $message = null) : void { + $this->doAssertion(new AssertCountEquals($expected, $actual), $message); + } + + public function instanceOf(string|object $expected, object $actual, string $message = null) : void { + $this->doAssertion(new AssertInstanceOf($expected, $actual), $message); + } + + public function isEmpty(mixed $actual, string $message = null) : void { + $this->doAssertion(new AssertIsEmpty($actual), $message); + } + + public function isTrue(bool $actual, string $message = null) : void { + $this->doAssertion(new AssertIsTrue($actual), $message); + } + + public function isFalse(bool $actual, string $message = null) : void { + $this->doAssertion(new AssertIsFalse($actual), $message); + } + + public function isNull(mixed $actual, string $message = null) : void { + $this->doAssertion(new AssertIsNull($actual), $message); + } + + public function __call(string $methodName, array $args) : void { + $this->doAssertion( + $this->customAssertionContext->createAssertion($methodName, ...$args), + null + ); + } + + private function doAssertion(Assertion $assertion, ?string $message) : void { + $isNot = $this->isNot; + $this->invokedAssertionContext(); + + $results = $assertion->assert(); + + $this->handleAssertionResults($results, $isNot, $message); + } + + private int $count = 0; + + private bool $isNot = false; + + public function getAssertionCount() : int { + return $this->count; + } + + public function not() : self { + $this->isNot = true; + return $this; + } + + private function getDefaultFailureMessage(string $assertionString) : string { + return sprintf("Failed %s", $assertionString); + } + + private function invokedAssertionContext() : void { + $this->count++; + $this->isNot = false; + } + + private function handleAssertionResults(AssertionResult $result, bool $isNot, ?string $customMessage) { + if (($isNot && $result->isSuccessful()) || (!$isNot && !$result->isSuccessful())) { + throw new AssertionFailedException( + $customMessage ?? $this->getDefaultFailureMessage($isNot ? $result->getSummary()->toNotString() : $result->getSummary()->toString()), + $this->getDefaultFailureMessage($isNot ? $result->getDetails()->toNotString() : $result->getDetails()->toString()), + ); + } + } + +} \ No newline at end of file diff --git a/framework_src/Context/CustomAssertionContext.php b/src/Framework/Context/CustomAssertionContext.php similarity index 53% rename from framework_src/Context/CustomAssertionContext.php rename to src/Framework/Context/CustomAssertionContext.php index 2e7cd37..3601371 100644 --- a/framework_src/Context/CustomAssertionContext.php +++ b/src/Framework/Context/CustomAssertionContext.php @@ -1,19 +1,16 @@ ensureValidMethodName($methodName, 'async assertion'); - $this->asyncAssertions[$methodName] = $asyncAssertionFactory; - } - - public function hasRegisteredAsyncAssertion(string $methodName) : bool { - return array_key_exists($methodName, $this->asyncAssertions); - } - - public function createAsyncAssertion(string $methodName, mixed ...$args) : AsyncAssertion { - if (!$this->hasRegisteredAsyncAssertion($methodName)) { - throw new InvalidArgumentException(sprintf( - 'There is no custom async assertion registered for "%s".', - $methodName - )); - } - $assertion = $this->asyncAssertions[$methodName](...$args); - if (!$assertion instanceof AsyncAssertion) { - $msg = sprintf( - 'The factory for custom async assertion "%s" must return an instance of %s', - $methodName, - AsyncAssertion::class - ); - throw new InvalidStateException($msg); - } - return $assertion; - } - private function ensureValidMethodName(string $methodName, string $assertionType) : void { if (!preg_match(self::VALID_METHOD_NAME_REGEX, $methodName)) { $msg = sprintf( diff --git a/framework_src/Context/ExpectationContext.php b/src/Framework/Context/ExpectationContext.php similarity index 89% rename from framework_src/Context/ExpectationContext.php rename to src/Framework/Context/ExpectationContext.php index 104586d..51499cc 100644 --- a/framework_src/Context/ExpectationContext.php +++ b/src/Framework/Context/ExpectationContext.php @@ -1,13 +1,13 @@ expectedAssertionCount)) { - $totalAssertionCount = $this->assertionContext->getAssertionCount() + $this->asyncAssertionContext->getAssertionCount(); + $totalAssertionCount = $this->assertionContext->getAssertionCount(); if ($totalAssertionCount !== $this->expectedAssertionCount) { $msg = sprintf( 'Expected %s::%s to make 0 assertions but made %s', @@ -78,7 +77,7 @@ private function validateAssertionCount() : ?TestFailedException { return null; } - if ($this->assertionContext->getAssertionCount() === 0 && $this->asyncAssertionContext->getAssertionCount() === 0) { + if ($this->assertionContext->getAssertionCount() === 0) { $msg = sprintf( 'Expected "%s::%s" #[Test] to make at least 1 Assertion but none were made.', $this->testModel->getClass(), diff --git a/framework_src/Context/TestExpector.php b/src/Framework/Context/TestExpector.php similarity index 82% rename from framework_src/Context/TestExpector.php rename to src/Framework/Context/TestExpector.php index 37f60a3..91092ea 100644 --- a/framework_src/Context/TestExpector.php +++ b/src/Framework/Context/TestExpector.php @@ -1,6 +1,6 @@ + */ +final class ProcessingFinishedEvent extends AbstractEvent { + + public function __construct(ProcessedAggregateSummary $summary) { + parent::__construct(Events::PROCESSING_FINISHED, $summary); + } + +} diff --git a/src/Framework/Event/ProcessingStartedEvent.php b/src/Framework/Event/ProcessingStartedEvent.php new file mode 100644 index 0000000..9b2f8b9 --- /dev/null +++ b/src/Framework/Event/ProcessingStartedEvent.php @@ -0,0 +1,17 @@ + + */ +final class ProcessingStartedEvent extends AbstractEvent { + + public function __construct(AggregateSummary $aggregateSummary) { + parent::__construct(Events::PROCESSING_STARTED, $aggregateSummary); + } + +} \ No newline at end of file diff --git a/src/Framework/Event/TestCaseFinishedEvent.php b/src/Framework/Event/TestCaseFinishedEvent.php new file mode 100644 index 0000000..6b90008 --- /dev/null +++ b/src/Framework/Event/TestCaseFinishedEvent.php @@ -0,0 +1,17 @@ + + */ +final class TestCaseFinishedEvent extends AbstractEvent { + + public function __construct(ProcessedTestCaseSummary $testCaseSummary) { + parent::__construct(Events::TEST_CASE_FINISHED, $testCaseSummary); + } + +} \ No newline at end of file diff --git a/src/Framework/Event/TestCaseStartedEvent.php b/src/Framework/Event/TestCaseStartedEvent.php new file mode 100644 index 0000000..37e089a --- /dev/null +++ b/src/Framework/Event/TestCaseStartedEvent.php @@ -0,0 +1,17 @@ + + */ +final class TestCaseStartedEvent extends AbstractEvent { + + public function __construct(TestCaseSummary $target) { + parent::__construct(Events::TEST_CASE_STARTED, $target); + } + +} diff --git a/src/Framework/Event/TestDisabledEvent.php b/src/Framework/Event/TestDisabledEvent.php new file mode 100644 index 0000000..48d88e0 --- /dev/null +++ b/src/Framework/Event/TestDisabledEvent.php @@ -0,0 +1,16 @@ + + */ +final class TestDisabledEvent extends AbstractEvent { + + public function __construct(TestResult $testResult) { + parent::__construct(Events::TEST_DISABLED, $testResult); + } +} diff --git a/src/Framework/Event/TestErroredEvent.php b/src/Framework/Event/TestErroredEvent.php new file mode 100644 index 0000000..6abfe96 --- /dev/null +++ b/src/Framework/Event/TestErroredEvent.php @@ -0,0 +1,17 @@ + + */ +final class TestErroredEvent extends AbstractEvent { + + public function __construct(TestResult $target) { + parent::__construct(Events::TEST_ERRORED, $target); + } + +} \ No newline at end of file diff --git a/src/Framework/Event/TestFailedEvent.php b/src/Framework/Event/TestFailedEvent.php new file mode 100644 index 0000000..d41ab7b --- /dev/null +++ b/src/Framework/Event/TestFailedEvent.php @@ -0,0 +1,17 @@ + + */ +final class TestFailedEvent extends AbstractEvent { + + public function __construct(TestResult $target) { + parent::__construct(Events::TEST_FAILED, $target); + } + +} \ No newline at end of file diff --git a/src/Framework/Event/TestPassedEvent.php b/src/Framework/Event/TestPassedEvent.php new file mode 100644 index 0000000..eb54664 --- /dev/null +++ b/src/Framework/Event/TestPassedEvent.php @@ -0,0 +1,16 @@ + + */ +final class TestPassedEvent extends AbstractEvent { + + public function __construct(TestResult $target) { + parent::__construct(Events::TEST_PASSED, $target); + } +} \ No newline at end of file diff --git a/src/Framework/Event/TestProcessedEvent.php b/src/Framework/Event/TestProcessedEvent.php new file mode 100644 index 0000000..806b33a --- /dev/null +++ b/src/Framework/Event/TestProcessedEvent.php @@ -0,0 +1,17 @@ + + */ +final class TestProcessedEvent extends AbstractEvent { + + public function __construct(TestResult $target) { + parent::__construct(Events::TEST_PROCESSED, $target); + } + +} \ No newline at end of file diff --git a/src/Framework/Event/TestSuiteFinishedEvent.php b/src/Framework/Event/TestSuiteFinishedEvent.php new file mode 100644 index 0000000..3a63b5a --- /dev/null +++ b/src/Framework/Event/TestSuiteFinishedEvent.php @@ -0,0 +1,17 @@ + + */ +final class TestSuiteFinishedEvent extends AbstractEvent { + + public function __construct(ProcessedTestSuiteSummary $target) { + parent::__construct(Events::TEST_SUITE_FINISHED, $target); + } + +} \ No newline at end of file diff --git a/src/Framework/Event/TestSuiteStartedEvent.php b/src/Framework/Event/TestSuiteStartedEvent.php new file mode 100644 index 0000000..747ac99 --- /dev/null +++ b/src/Framework/Event/TestSuiteStartedEvent.php @@ -0,0 +1,17 @@ + + */ +final class TestSuiteStartedEvent extends AbstractEvent { + + public function __construct(TestSuiteSummary $testSuiteSummary) { + parent::__construct(Events::TEST_SUITE_STARTED, $testSuiteSummary); + } + +} \ No newline at end of file diff --git a/framework_src/Exception/AssertionFailedException.php b/src/Framework/Exception/AssertionFailedException.php similarity index 50% rename from framework_src/Exception/AssertionFailedException.php rename to src/Framework/Exception/AssertionFailedException.php index efb29e5..1109123 100644 --- a/framework_src/Exception/AssertionFailedException.php +++ b/src/Framework/Exception/AssertionFailedException.php @@ -1,14 +1,12 @@ detailedMessage; } - public function getAssertionFailureFile() : string { - return $this->assertionFailureFile; - } - - public function getAssertionFailureLine() : int { - return $this->assertionFailureLine; - } - -} \ No newline at end of file +} diff --git a/framework_src/Exception/Exception.php b/src/Framework/Exception/Exception.php similarity index 66% rename from framework_src/Exception/Exception.php rename to src/Framework/Exception/Exception.php index 139a33c..e560f33 100644 --- a/framework_src/Exception/Exception.php +++ b/src/Framework/Exception/Exception.php @@ -1,6 +1,6 @@ $stateTests) { if ($state === 'duration') { continue; @@ -102,7 +100,6 @@ public function finishTestCase(TestCaseModel $testCaseModel) : ProcessedTestCase } foreach ($stateTests as $test) { $assertionCount += $test['assertion']; - $asyncAssertionCount += $test['asyncAssertion']; } } return new class( @@ -115,7 +112,6 @@ public function finishTestCase(TestCaseModel $testCaseModel) : ProcessedTestCase $failedTestCount, $erroredTestCount, $assertionCount, - $asyncAssertionCount, $duration ) implements ProcessedTestCaseSummary { @@ -129,7 +125,6 @@ public function __construct( private int $failedTestCount, private int $erroredTestCount, private int $assertionCount, - private int $asyncAssertionCount, private Duration $duration ) {} @@ -169,10 +164,6 @@ public function getAssertionCount() : int { return $this->assertionCount; } - public function getAsyncAssertionCount() : int { - return $this->asyncAssertionCount; - } - public function getDuration() : Duration { return $this->duration; } @@ -180,7 +171,7 @@ public function getDuration() : Duration { } public function processedTest(TestResult $testResult) : void { - $testSuiteClass = $testResult->getTestCase()->testSuite()::class; + $testSuiteClass = $testResult->getTestCase()->testSuite::class; $testCaseClass = $testResult->getTestCase()::class; $key = isset($this->testSuites[$testSuiteClass]['enabled'][$testCaseClass]) ? 'enabled' : 'disabled'; $stateKey = $testResult->getState()->name; @@ -191,13 +182,11 @@ public function processedTest(TestResult $testResult) : void { $testName = sprintf('%s::%s#%s', $testCaseClass, $testResult->getTestMethod(), $testResult->getDataSetLabel()); } $this->testSuites[$testSuiteClass][$key][$testCaseClass][$stateKey][$testName] = [ - 'assertion' => $testResult->getTestCase()->getAssertionCount(), - 'asyncAssertion' => $testResult->getTestCase()->getAsyncAssertionCount() + 'assertion' => $testResult->getTestCase()->getAssertionCount() ]; $this->totalTestCount++; $this->assertionCount += $testResult->getTestCase()->getAssertionCount(); - $this->asyncAssertionCount += $testResult->getTestCase()->getAsyncAssertionCount(); if (TestState::Disabled === $testResult->getState()) { $this->disabledTestCount++; } else if (TestState::Passed === $testResult->getState()) { @@ -229,7 +218,6 @@ private function buildAggregate() : ProcessedAggregateSummary { $this->failedTestCount, $this->erroredTestCount, $this->assertionCount, - $this->asyncAssertionCount, $this->duration, $this->memoryUsageInBytes ) implements ProcessedAggregateSummary { @@ -246,7 +234,6 @@ public function __construct( private int $failedTestCount, private int $erroredTestCount, private int $assertionCount, - private int $asyncAssertionCount, private Duration $duration, private int $memoryUsageInBytes ) {} @@ -302,10 +289,6 @@ public function getMemoryUsageInBytes() : int { public function getAssertionCount() : int { return $this->assertionCount; } - - public function getAsyncAssertionCount() : int { - return $this->asyncAssertionCount; - } }; } @@ -319,7 +302,6 @@ private function buildTestSuiteSummary(TestSuiteModel $testSuiteModel) : Process $failedTestCount = 0; $erroredTestCount = 0; $assertionCount = 0; - $asyncAssertionCount = 0; foreach ($enabledTestCases as $testCase) { $tests = $this->testSuites[$testSuiteName]['enabled'][$testCase]; $passedTestCount += count($tests[TestState::Passed->name]); @@ -328,11 +310,9 @@ private function buildTestSuiteSummary(TestSuiteModel $testSuiteModel) : Process $disabledTestCount += count($tests[TestState::Disabled->name]); foreach ($tests[TestState::Passed->name] as $assertionCounts) { $assertionCount += $assertionCounts['assertion']; - $asyncAssertionCount += $assertionCounts['asyncAssertion']; } foreach ($tests[TestState::Failed->name] as $assertionCounts) { $assertionCount += $assertionCounts['assertion']; - $asyncAssertionCount += $assertionCounts['asyncAssertion']; } } @@ -360,7 +340,6 @@ private function buildTestSuiteSummary(TestSuiteModel $testSuiteModel) : Process $failedTestCount, $erroredTestCount, $assertionCount, - $asyncAssertionCount, $this->testSuites[$testSuiteName]['duration'] ) implements ProcessedTestSuiteSummary { @@ -375,7 +354,6 @@ public function __construct( private int $failedTestCount, private int $erroredTestCount, private int $assertionCount, - private int $asyncAssertionCount, private Duration $duration ) {} @@ -419,10 +397,6 @@ public function getAssertionCount() : int { return $this->assertionCount; } - public function getAsyncAssertionCount() : int { - return $this->asyncAssertionCount; - } - public function getDuration() : Duration { return $this->duration; } diff --git a/framework_src/Statistics/ProcessedTestCaseSummary.php b/src/Framework/Statistics/ProcessedTestCaseSummary.php similarity index 85% rename from framework_src/Statistics/ProcessedTestCaseSummary.php rename to src/Framework/Statistics/ProcessedTestCaseSummary.php index 2e2a2d3..fd5df2c 100644 --- a/framework_src/Statistics/ProcessedTestCaseSummary.php +++ b/src/Framework/Statistics/ProcessedTestCaseSummary.php @@ -1,7 +1,7 @@ assert->getAssertionCount(); + } + + final protected function expect() : TestExpector { + return $this->expectationContext; + } + + final public function mocks() : MockBridge { + if (is_null($this->testMocker)) { + $msg = 'Attempted to create a mock but no MockBridge was defined. Please ensure you\'ve configured a mockBridge in your configuration.'; + throw new InvalidStateException($msg); + } + + return $this->testMocker; + } + +} diff --git a/framework_src/TestResult.php b/src/Framework/TestResult.php similarity index 66% rename from framework_src/TestResult.php rename to src/Framework/TestResult.php index 5e1019d..61540e9 100644 --- a/framework_src/TestResult.php +++ b/src/Framework/TestResult.php @@ -1,18 +1,18 @@ randomizer->randomize($testCaseModel->getTestModels()); foreach ($testMethodModels as $testMethodModel) { /** @var AssertionContext $assertionContext */ - /** @var AsyncAssertionContext $asyncAssertionContext */ [ $testCase, $assertionContext, - $asyncAssertionContext, $expectationContext, $mockBridge ] = $this->invokeTestCaseConstructor($testCaseModel->getClass(), $testSuite, $testMethodModel); @@ -122,7 +122,6 @@ public function runTestSuites(ParserResult $parserResult) : void { $aggregateSummaryBuilder, $testCase, $assertionContext, - $asyncAssertionContext, $expectationContext, $mockBridge, $testSuiteModel, @@ -134,7 +133,6 @@ public function runTestSuites(ParserResult $parserResult) : void { [ $testCase, $assertionContext, - $asyncAssertionContext, $expectationContext, $mockBridge ] = $this->invokeTestCaseConstructor($testCaseModel->getClass(), $testSuite, $testMethodModel); @@ -144,7 +142,6 @@ public function runTestSuites(ParserResult $parserResult) : void { $aggregateSummaryBuilder, $testCase, $assertionContext, - $asyncAssertionContext, $expectationContext, $mockBridge, $testSuiteModel, @@ -211,7 +208,6 @@ private function invokeTest( ProcessedSummaryBuilder $aggregateSummaryBuilder, TestCase $testCase, AssertionContext $assertionContext, - AsyncAssertionContext $asyncAssertionContext, ExpectationContext $expectationContext, ?MockBridge $mockBridge, TestSuiteModel $testSuiteModel, @@ -237,7 +233,7 @@ private function invokeTest( $mockBridge->initialize(); } - $this->invokeHooks($testCase->testSuite(), $testSuiteModel, HookType::BeforeEachTest, TestSetupException::class); + $this->invokeHooks($testCase->testSuite, $testSuiteModel, HookType::BeforeEachTest, TestSetupException::class); $this->invokeHooks($testCase, $testCaseModel, HookType::BeforeEach, TestSetupException::class); $testCaseMethod = $testModel->getMethod(); @@ -300,7 +296,7 @@ private function invokeTest( } $this->invokeHooks($testCase, $testCaseModel, HookType::AfterEach, TestTearDownException::class); - $this->invokeHooks($testCase->testSuite(), $testSuiteModel, HookType::AfterEachTest, TestTearDownException::class); + $this->invokeHooks($testCase->testSuite, $testSuiteModel, HookType::AfterEachTest, TestTearDownException::class); $this->emitter->emit(new TestProcessedEvent($testResult))->awaitAll(); @@ -410,7 +406,6 @@ private function invokeTestCaseConstructor(string $testCaseClass, TestSuite $tes $reflectionClass = $this->getReflectionClass($testCaseClass); $testCaseObject = $reflectionClass->newInstanceWithoutConstructor(); $reflectedAssertionContext = $this->getReflectionClass(AssertionContext::class); - $reflectedAsyncAssertionContext = $this->getReflectionClass(AsyncAssertionContext::class); $reflectedExpectationContext = $this->getReflectionClass(ExpectationContext::class); $testCaseConstructor = $reflectionClass->getConstructor(); assert($testCaseConstructor !== null); @@ -420,11 +415,6 @@ private function invokeTestCaseConstructor(string $testCaseClass, TestSuite $tes assert($assertionContextConstructor !== null); $assertionContextConstructor->invoke($assertionContext, $this->customAssertionContext); - $asyncAssertionContext = $reflectedAsyncAssertionContext->newInstanceWithoutConstructor(); - $asyncAssertionContextConstructor = $reflectedAsyncAssertionContext->getConstructor(); - assert($asyncAssertionContextConstructor !== null); - $asyncAssertionContextConstructor->invoke($asyncAssertionContext, $this->customAssertionContext); - $testMocker = null; if (isset($this->mockBridgeClass)) { $testMocker = $this->mockBridgeFactory->make($this->mockBridgeClass); @@ -433,17 +423,16 @@ private function invokeTestCaseConstructor(string $testCaseClass, TestSuite $tes $expectationContext = $reflectedExpectationContext->newInstanceWithoutConstructor(); $expectationContextConstructor = $reflectedExpectationContext->getConstructor(); assert($expectationContextConstructor !== null); - $expectationContextConstructor->invoke($expectationContext, $testModel, $assertionContext, $asyncAssertionContext, $testMocker); + $expectationContextConstructor->invoke($expectationContext, $testModel, $assertionContext, $testMocker); $testCaseConstructor->invoke( $testCaseObject, $testSuite, $assertionContext, - $asyncAssertionContext, $expectationContext, $testMocker ); - return [$testCaseObject, $assertionContext, $asyncAssertionContext, $expectationContext, $testMocker]; + return [$testCaseObject, $assertionContext, $expectationContext, $testMocker]; } } \ No newline at end of file diff --git a/framework_test/Assertion/AbstractAssertionTestCase.php b/tests/Unit/Framework/Assertion/AbstractAssertionTestCase.php similarity index 93% rename from framework_test/Assertion/AbstractAssertionTestCase.php rename to tests/Unit/Framework/Assertion/AbstractAssertionTestCase.php index 9ef943c..bb00699 100644 --- a/framework_test/Assertion/AbstractAssertionTestCase.php +++ b/tests/Unit/Framework/Assertion/AbstractAssertionTestCase.php @@ -1,8 +1,8 @@ mockBridgeStub = new MockBridgeStub(); $this->mockBridgeFactory = $this->createMock(MockBridgeFactory::class); - $emitter = new AmpEventEmitter(); + $emitter = new AmpEmitter(); $application = new AsyncUnitApplication( new AsyncUnitConfigurationValidator(), @@ -66,23 +73,23 @@ private function getStateAndApplication( $state->events = [ Events::TEST_DISABLED => [], Events::TEST_PASSED => [], - Events::TEST_FAILED => [] + Events::TEST_FAILED => [], + Events::TEST_ERRORED => [], ]; - $listener = new class($state) extends AbstractListener { + $listener = new class($state) implements Listener { public function __construct(private readonly stdClass $data) {} - public function canHandle(string $eventName) : bool { - return in_array($eventName, [Events::TEST_PASSED, Events::TEST_FAILED, Events::TEST_DISABLED], true); - } - public function handle(Event $event) : Future|CompositeFuture|null { - $this->data->events[$event->getName()][] = $event; + $this->data->events[$event->name()][] = $event; return null; } }; - $emitter->register($listener); + $emitter->register(Events::TEST_PASSED, $listener); + $emitter->register(Events::TEST_FAILED, $listener); + $emitter->register(Events::TEST_DISABLED, $listener); + $emitter->register(Events::TEST_ERRORED, $listener); return [$state, $application]; } @@ -100,33 +107,13 @@ public function testSimpleTestCaseImplicitDefaultTestSuiteSingleTest() : void { $event = $state->events[Events::TEST_PASSED][0]; $this->assertInstanceOf(TestPassedEvent::class, $event); - $testResult = $event->getTarget(); + $testResult = $event->payload(); $this->assertInstanceOf(ImplicitDefaultTestSuite\SingleTest\MyTestCase::class, $testResult->getTestCase()); $this->assertSame('ensureSomethingHappens', $testResult->getTestMethod()); $this->assertSame(TestState::Passed, $testResult->getState()); } - public function testSimpleTestCaseImplicitDefaultTestSuiteSingleTestAsyncAssertion() : void { - $configuration = new TestConfiguration(); - $configuration->setTestDirectories([$this->implicitDefaultTestSuitePath('SingleTestAsyncAssertion')]); - [$state, $application] = $this->getStateAndApplication('singleTestAsync', $configuration); - - $application->run(); - - $this->assertCount(1, $state->events[Events::TEST_PASSED]); - $this->assertCount(0, $state->events[Events::TEST_FAILED]); - /** @var TestPassedEvent $event */ - $event = $state->events[Events::TEST_PASSED][0]; - $this->assertInstanceOf(TestPassedEvent::class, $event); - - $testResult = $event->getTarget(); - - $this->assertInstanceOf(ImplicitDefaultTestSuite\SingleTestAsyncAssertion\MyTestCase::class, $testResult->getTestCase()); - $this->assertSame('ensureAsyncAssert', $testResult->getTestMethod()); - $this->assertSame(TestState::Passed, $testResult->getState()); - } - public function testSimpleTestCaseImplicitDefaultTestSuiteNoAssertions() : void { $configuration = new TestConfiguration(); $configuration->setTestDirectories([$this->implicitDefaultTestSuitePath('NoAssertions')]); @@ -140,7 +127,7 @@ public function testSimpleTestCaseImplicitDefaultTestSuiteNoAssertions() : void $event = $state->events[Events::TEST_FAILED][0]; $this->assertInstanceOf(TestFailedEvent::class, $event); - $testResult = $event->getTarget(); + $testResult = $event->payload(); $this->assertInstanceOf(ImplicitDefaultTestSuite\NoAssertions\MyTestCase::class, $testResult->getTestCase()); $this->assertSame('noAssertions', $testResult->getTestMethod()); @@ -166,7 +153,7 @@ public function testSimpleTestCaseImplicitDefaultTestSuiteFailedAssertion() { $event = $state->events[Events::TEST_FAILED][0]; $this->assertInstanceOf(TestFailedEvent::class, $event); - $testResult = $event->getTarget(); + $testResult = $event->payload(); $this->assertSame(TestState::Failed, $testResult->getState()); } @@ -222,7 +209,7 @@ public function testExplicitTestSuiteTestCaseAfterAllHasTestSuiteState() { $this->assertCount(1, $state->events[Events::TEST_PASSED]); $this->assertCount(0, $state->events[Events::TEST_FAILED]); - $this->assertSame('AsyncUnit', $state->events[Events::TEST_PASSED][0]->getTarget()->getTestCase()->getState()); + $this->assertSame('AsyncUnit', $state->events[Events::TEST_PASSED][0]->payload()->getTestCase()->getState()); } public function testConfigurationInvalidThrowsException() { diff --git a/framework_test/AsyncUnitAssertions.php b/tests/Unit/Framework/AsyncUnitAssertions.php similarity index 64% rename from framework_test/AsyncUnitAssertions.php rename to tests/Unit/Framework/AsyncUnitAssertions.php index a6d2924..bb35180 100644 --- a/framework_test/AsyncUnitAssertions.php +++ b/tests/Unit/Framework/AsyncUnitAssertions.php @@ -1,11 +1,11 @@ willReturn($configuration); $frameworkRunner = new AsyncUnitFrameworkRunner( - $logger, - new AmpEventEmitter(), + new AmpEmitter(), $configurationFactory, - new WritableBuffer() ); $frameworkRunner->run('configPath'); @@ -45,10 +44,8 @@ public function testFailedAssertionTest() { ->willReturn($configuration); $frameworkRunner = new AsyncUnitFrameworkRunner( - $logger, - new AmpEventEmitter(), + new AmpEmitter(), $configurationFactory, - new WritableBuffer() ); $frameworkRunner->run('configPath'); @@ -66,10 +63,8 @@ public function testSingleMockWithNoAssertion() { ->willReturn($configuration); $frameworkRunner = new AsyncUnitFrameworkRunner( - $logger, - new AmpEventEmitter(), + new AmpEmitter(), $configurationFactory, - new WritableBuffer() ); $frameworkRunner->run('configPath'); diff --git a/framework_test/Constraint/TestCaseModelHasTestMethod.php b/tests/Unit/Framework/Constraint/TestCaseModelHasTestMethod.php similarity index 83% rename from framework_test/Constraint/TestCaseModelHasTestMethod.php rename to tests/Unit/Framework/Constraint/TestCaseModelHasTestMethod.php index 062fdb3..772d8e9 100644 --- a/framework_test/Constraint/TestCaseModelHasTestMethod.php +++ b/tests/Unit/Framework/Constraint/TestCaseModelHasTestMethod.php @@ -1,9 +1,9 @@ $model->getClass(), $testCases); + $testCaseClasses = array_map(static fn(TestCaseModel $model) => $model->getClass(), $testCases); return in_array($this->expectedClass, $testCaseClasses, true); } diff --git a/framework_test/Constraint/TestSuiteModelHasTestCaseModelTest.php b/tests/Unit/Framework/Constraint/TestSuiteModelHasTestCaseModelTest.php similarity index 85% rename from framework_test/Constraint/TestSuiteModelHasTestCaseModelTest.php rename to tests/Unit/Framework/Constraint/TestSuiteModelHasTestCaseModelTest.php index 7c9a74e..2639e1e 100644 --- a/framework_test/Constraint/TestSuiteModelHasTestCaseModelTest.php +++ b/tests/Unit/Framework/Constraint/TestSuiteModelHasTestCaseModelTest.php @@ -1,11 +1,11 @@ subject = $reflectedClass->newInstanceWithoutConstructor(); + } + + public function testHasAssertionContextFalseIfEmpty() { + $this->assertFalse($this->subject->hasRegisteredAssertion('someMethodName')); + } + + public function testRegisterAssertionWithInvalidName() { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('A registered custom assertion must have a valid method name but "bad value with spaces" was provided'); + + $this->subject->registerAssertion('bad value with spaces', function() {}); + } + + public function testRegisterAssertionHasAssertionReturnsTrue() { + $this->subject->registerAssertion('ensureCustomThing', function() {}); + + $this->assertTrue($this->subject->hasRegisteredAssertion('ensureCustomThing')); + } + + public function testCreateAssertionDoesNotExistThrowsException() { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('There is no custom assertion registered for "customAssertionName".'); + + $this->subject->createAssertion('customAssertionName'); + } + + public function testCreateRegisteredFactoryDoesNotReturnAssertionThrowsException() { + $this->subject->registerAssertion('ensureSomething', fn() => 'not an assertion'); + + $this->expectException(InvalidStateException::class); + $this->expectExceptionMessage('The factory for custom assertion "ensureSomething" must return an instance of ' . Assertion::class); + + $this->subject->createAssertion('ensureSomething'); + } + + public function testCreateRegisteredFactoryIsAssertionReturnsObject() { + $assertion = $this->getMockBuilder(Assertion::class)->getMock(); + $this->subject->registerAssertion('ensureSomething', fn() => $assertion); + + $actual = $this->subject->createAssertion('ensureSomething'); + + $this->assertSame($assertion, $actual); + } + + public function testRegisteredAssertionFactoryReceivesArgs() { + $assertion = $this->getMockBuilder(Assertion::class)->getMock(); + $state = new \stdClass(); + $state->args = null; + $this->subject->registerAssertion('ensureSomething', function(...$args) use($state, $assertion) { + $state->args = $args; + return $assertion; + }); + + $this->subject->createAssertion('ensureSomething', 1, 'a', 'b', ['1', '2', 3]); + $this->assertNotNull($state->args); + $this->assertSame([1, 'a', 'b', ['1', '2', 3]], $state->args); + } +} \ No newline at end of file diff --git a/framework_test/JsonConfigurationFactoryTest.php b/tests/Unit/Framework/JsonConfigurationFactoryTest.php similarity index 91% rename from framework_test/JsonConfigurationFactoryTest.php rename to tests/Unit/Framework/JsonConfigurationFactoryTest.php index 1ab8634..8f7d515 100644 --- a/framework_test/JsonConfigurationFactoryTest.php +++ b/tests/Unit/Framework/JsonConfigurationFactoryTest.php @@ -1,11 +1,11 @@ initialize(); + $mock = $subject->createMock(Configuration::class); + + $mock->shouldReceive('getTestDirectories')->once()->andReturn([]); + + $this->expectException(MockFailureException::class); + + $subject->finalize(); + } + + public function testMockWithGoodPredictions() : void { + $subject = new MockeryMockBridge(); + + $subject->initialize(); + $mock = $subject->createMock(Configuration::class); + + $mock->shouldReceive('getTestDirectories')->once()->andReturn([]); + + $mock->getTestDirectories(); + + $subject->finalize(); + + self::assertSame(1, $subject->getAssertionCount()); + } + +} \ No newline at end of file diff --git a/tests/Unit/Framework/MockBridge/ProphecyMockBridgeTest.php b/tests/Unit/Framework/MockBridge/ProphecyMockBridgeTest.php new file mode 100644 index 0000000..5373806 --- /dev/null +++ b/tests/Unit/Framework/MockBridge/ProphecyMockBridgeTest.php @@ -0,0 +1,54 @@ +initialize(); + $mock = $subject->createMock(Configuration::class); + + $mock->getTestDirectories()->shouldBeCalled()->willReturn([]); + + $this->expectException(MockFailureException::class); + + $subject->finalize(); + } + + public function testMockWithGoodPredictions() { + $subject = new ProphecyMockBridge(); + + $subject->initialize(); + $mock = $subject->createMock(Configuration::class); + + $mock->getTestDirectories()->shouldBeCalled()->willReturn([]); + + $mock->reveal()->getTestDirectories(); + + $subject->finalize(); + + self::assertSame(1, $subject->getAssertionCount()); + } + + public function testMockAssertionCount() { + $subject = new ProphecyMockBridge(); + + $subject->initialize(); + $mock = $subject->createMock(Configuration::class); + + $mock->getTestDirectories()->shouldBeCalled()->willReturn([]); + + $secondMock = $subject->createMock(Configuration::class); + $secondMock->getTestDirectories()->shouldBeCalled()->willReturn([]); + + $this->assertSame(2, $subject->getAssertionCount()); + } + +} \ No newline at end of file diff --git a/framework_test/Resources/dummy_configs/bad_keys.json b/tests/Unit/Framework/Resources/dummy_configs/bad_keys.json similarity index 100% rename from framework_test/Resources/dummy_configs/bad_keys.json rename to tests/Unit/Framework/Resources/dummy_configs/bad_keys.json diff --git a/framework_test/Resources/dummy_configs/empty_object.json b/tests/Unit/Framework/Resources/dummy_configs/empty_object.json similarity index 100% rename from framework_test/Resources/dummy_configs/empty_object.json rename to tests/Unit/Framework/Resources/dummy_configs/empty_object.json diff --git a/framework_test/Resources/dummy_configs/good_keys_bad_types.json b/tests/Unit/Framework/Resources/dummy_configs/good_keys_bad_types.json similarity index 100% rename from framework_test/Resources/dummy_configs/good_keys_bad_types.json rename to tests/Unit/Framework/Resources/dummy_configs/good_keys_bad_types.json diff --git a/framework_test/Resources/dummy_configs/good_keys_but_extra.json b/tests/Unit/Framework/Resources/dummy_configs/good_keys_but_extra.json similarity index 100% rename from framework_test/Resources/dummy_configs/good_keys_but_extra.json rename to tests/Unit/Framework/Resources/dummy_configs/good_keys_but_extra.json diff --git a/tests/Unit/Framework/Resources/dummy_configs/has_mock_bridge.json b/tests/Unit/Framework/Resources/dummy_configs/has_mock_bridge.json new file mode 100644 index 0000000..11a9e4e --- /dev/null +++ b/tests/Unit/Framework/Resources/dummy_configs/has_mock_bridge.json @@ -0,0 +1,5 @@ +{ + "testDirectories": ["."], + "resultPrinter": "Cspray\\Labrador\\AsyncUnitCli\\DefaultResultPrinter", + "mockBridge": "Labrador\\AsyncUnit\\Framework\\MockBridge\\MockeryMockBridge" +} diff --git a/tests/Unit/Framework/Resources/dummy_configs/has_plugins.json b/tests/Unit/Framework/Resources/dummy_configs/has_plugins.json new file mode 100644 index 0000000..3189a63 --- /dev/null +++ b/tests/Unit/Framework/Resources/dummy_configs/has_plugins.json @@ -0,0 +1,5 @@ +{ + "testDirectories": ["."], + "resultPrinter": "Labrador\\AsyncUnit\\Cli\\DefaultResultPrinter", + "plugins": ["FooBar"] +} \ No newline at end of file diff --git a/tests/Unit/Framework/Resources/dummy_configs/minimally_valid.json b/tests/Unit/Framework/Resources/dummy_configs/minimally_valid.json new file mode 100644 index 0000000..8f351e9 --- /dev/null +++ b/tests/Unit/Framework/Resources/dummy_configs/minimally_valid.json @@ -0,0 +1,5 @@ +{ + "testDirectories": ["."], + "resultPrinter": "Labrador\\AsyncUnit\\Cli\\TerminalResultPrinter", + "mockBridge": "Cspray\\Labrador\\AsyncUnit\\Stub\\MockBridgeStub" +} \ No newline at end of file diff --git a/framework_test/Resources/dummy_configs/mock_bridge_empty_string.json b/tests/Unit/Framework/Resources/dummy_configs/mock_bridge_empty_string.json similarity index 100% rename from framework_test/Resources/dummy_configs/mock_bridge_empty_string.json rename to tests/Unit/Framework/Resources/dummy_configs/mock_bridge_empty_string.json diff --git a/framework_test/Resources/dummy_configs/plugins_empty.json b/tests/Unit/Framework/Resources/dummy_configs/plugins_empty.json similarity index 100% rename from framework_test/Resources/dummy_configs/plugins_empty.json rename to tests/Unit/Framework/Resources/dummy_configs/plugins_empty.json diff --git a/framework_test/Resources/dummy_configs/plugins_empty_string.json b/tests/Unit/Framework/Resources/dummy_configs/plugins_empty_string.json similarity index 100% rename from framework_test/Resources/dummy_configs/plugins_empty_string.json rename to tests/Unit/Framework/Resources/dummy_configs/plugins_empty_string.json diff --git a/framework_test/Resources/dummy_configs/plugins_non_string.json b/tests/Unit/Framework/Resources/dummy_configs/plugins_non_string.json similarity index 100% rename from framework_test/Resources/dummy_configs/plugins_non_string.json rename to tests/Unit/Framework/Resources/dummy_configs/plugins_non_string.json diff --git a/framework_test/Resources/dummy_configs/result_printer_empty.json b/tests/Unit/Framework/Resources/dummy_configs/result_printer_empty.json similarity index 100% rename from framework_test/Resources/dummy_configs/result_printer_empty.json rename to tests/Unit/Framework/Resources/dummy_configs/result_printer_empty.json diff --git a/framework_test/Resources/dummy_configs/result_printer_null.json b/tests/Unit/Framework/Resources/dummy_configs/result_printer_null.json similarity index 100% rename from framework_test/Resources/dummy_configs/result_printer_null.json rename to tests/Unit/Framework/Resources/dummy_configs/result_printer_null.json diff --git a/framework_test/Resources/dummy_configs/test_dirs_empty.json b/tests/Unit/Framework/Resources/dummy_configs/test_dirs_empty.json similarity index 100% rename from framework_test/Resources/dummy_configs/test_dirs_empty.json rename to tests/Unit/Framework/Resources/dummy_configs/test_dirs_empty.json diff --git a/framework_test/Resources/dummy_configs/test_dirs_empty_string.json b/tests/Unit/Framework/Resources/dummy_configs/test_dirs_empty_string.json similarity index 100% rename from framework_test/Resources/dummy_configs/test_dirs_empty_string.json rename to tests/Unit/Framework/Resources/dummy_configs/test_dirs_empty_string.json diff --git a/framework_test/Resources/dummy_configs/test_dirs_non_string.json b/tests/Unit/Framework/Resources/dummy_configs/test_dirs_non_string.json similarity index 100% rename from framework_test/Resources/dummy_configs/test_dirs_non_string.json rename to tests/Unit/Framework/Resources/dummy_configs/test_dirs_non_string.json diff --git a/framework_test/ShuffleRandomizerTest.php b/tests/Unit/Framework/ShuffleRandomizerTest.php similarity index 79% rename from framework_test/ShuffleRandomizerTest.php rename to tests/Unit/Framework/ShuffleRandomizerTest.php index 2415261..090a67a 100644 --- a/framework_test/ShuffleRandomizerTest.php +++ b/tests/Unit/Framework/ShuffleRandomizerTest.php @@ -1,7 +1,8 @@ acmeSrcDir = dirname(__DIR__) . '/acme_src'; + $this->acmeSrcDir = dirname(__DIR__, 3) . '/acme_src'; $this->subject = new StaticAnalysisParser(); } diff --git a/framework_test/Statistics/SummaryCalculatorTest.php b/tests/Unit/Framework/Statistics/SummaryCalculatorTest.php similarity index 98% rename from framework_test/Statistics/SummaryCalculatorTest.php rename to tests/Unit/Framework/Statistics/SummaryCalculatorTest.php index f7c50ac..93c06a1 100644 --- a/framework_test/Statistics/SummaryCalculatorTest.php +++ b/tests/Unit/Framework/Statistics/SummaryCalculatorTest.php @@ -1,10 +1,11 @@ assert->not()->stringEquals('foo', 'bar'); + } + + public function doFailingNotAssertions() { + $this->assert->not()->stringEquals('foo', 'foo'); + } + + public function doBothAssertions() { + $this->assert->stringEquals('bar', 'bar'); + $this->assert->not()->stringEquals('foo', 'bar'); + $this->assert->stringEquals('foo', 'foo'); + } + +} \ No newline at end of file diff --git a/framework_test/Stub/BarAssertionPlugin.php b/tests/Unit/Framework/Stub/BarAssertionPlugin.php similarity index 71% rename from framework_test/Stub/BarAssertionPlugin.php rename to tests/Unit/Framework/Stub/BarAssertionPlugin.php index da41a33..86b945c 100644 --- a/framework_test/Stub/BarAssertionPlugin.php +++ b/tests/Unit/Framework/Stub/BarAssertionPlugin.php @@ -1,11 +1,11 @@ assert->myCustomAssertion(1, 2, 3); + } + +} \ No newline at end of file diff --git a/framework_test/Stub/FailingMockBridgeFactory.php b/tests/Unit/Framework/Stub/FailingMockBridgeFactory.php similarity index 55% rename from framework_test/Stub/FailingMockBridgeFactory.php rename to tests/Unit/Framework/Stub/FailingMockBridgeFactory.php index 411532c..7c575e4 100644 --- a/framework_test/Stub/FailingMockBridgeFactory.php +++ b/tests/Unit/Framework/Stub/FailingMockBridgeFactory.php @@ -1,9 +1,9 @@ assert->stringEquals('foo', 'bar'); + } + + public function doFailureWithCustomMessage() { + $this->assert->stringEquals('foo', 'bar', 'my custom message'); + } + +} \ No newline at end of file diff --git a/framework_test/Stub/FooAssertionPlugin.php b/tests/Unit/Framework/Stub/FooAssertionPlugin.php similarity index 71% rename from framework_test/Stub/FooAssertionPlugin.php rename to tests/Unit/Framework/Stub/FooAssertionPlugin.php index 1030cf3..281ab04 100644 --- a/framework_test/Stub/FooAssertionPlugin.php +++ b/tests/Unit/Framework/Stub/FooAssertionPlugin.php @@ -1,11 +1,11 @@ createdMock = $this->mocks()->createMock(LoggerInterface::class); - $this->assert()->not()->isNull($this->createdMock); + $this->assert->not()->isNull($this->createdMock); } public function getCreatedMock() : ?object { diff --git a/framework_test/Stub/MockBridgeStub.php b/tests/Unit/Framework/Stub/MockBridgeStub.php similarity index 85% rename from framework_test/Stub/MockBridgeStub.php rename to tests/Unit/Framework/Stub/MockBridgeStub.php index 3ad74ea..b7a0b56 100644 --- a/framework_test/Stub/MockBridgeStub.php +++ b/tests/Unit/Framework/Stub/MockBridgeStub.php @@ -1,9 +1,9 @@ getSubjectAndContexts(FailingTestCase::class); - $assertionException = null; - try { - $subject->doFailure(); - } catch (AssertionFailedException $exception) { - $assertionException = $exception; - } finally { - $this->assertNotNull($assertionException); - $this->assertSame('Failed asserting type "string" equals type "string"', $assertionException->getMessage()); - $this->assertSame(__DIR__ . '/Stub/FailingTestCase.php', $assertionException->getAssertionFailureFile()); - $this->assertSame(11, $assertionException->getAssertionFailureLine()); - } - } - public function testFailingAssertionHasCustomMessage() { [$subject] = $this->getSubjectAndContexts(FailingTestCase::class); $assertionException = null; @@ -49,39 +32,16 @@ public function testFailingAssertionHasCustomMessage() { } finally { $this->assertNotNull($assertionException); $this->assertSame('my custom message', $assertionException->getMessage()); - $this->assertSame(__DIR__ . '/Stub/FailingTestCase.php', $assertionException->getAssertionFailureFile()); - $this->assertSame(19, $assertionException->getAssertionFailureLine()); - } - } - - public function testFailingAsyncAssertionHasFileAndLine() { - [$subject] = $this->getSubjectAndContexts(FailingTestCase::class); - - $assertionException = null; - try { - async($subject->doAsyncFailure(...))->await(); - } catch (AssertionFailedException $exception) { - $assertionException = $exception; - } finally { - $this->assertNotNull($assertionException); - $this->assertSame('Failed asserting type "string" equals type "string"', $assertionException->getMessage()); - $this->assertSame(__DIR__ . '/Stub/FailingTestCase.php', $assertionException->getAssertionFailureFile()); - $this->assertSame(15, $assertionException->getAssertionFailureLine()); } } public function testRunningOnlyNotAssertionPassing() { /** @var AssertNotTestCase $subject */ /** @var AssertionContext $assertionContext */ - /** @var AsyncAssertionContext $asyncAssertionContext */ - [$subject, $assertionContext, $asyncAssertionContext] = $this->getSubjectAndContexts(AssertNotTestCase::class); + [$subject, $assertionContext] = $this->getSubjectAndContexts(AssertNotTestCase::class); $subject->doNotAssertion(); $this->assertEquals(1, $assertionContext->getAssertionCount()); - - async($subject->doAsyncNotAssertion(...))->await(); - - $this->assertEquals(1, $asyncAssertionContext->getAssertionCount()); } public function testRunningOnlyNotAssertionFailing() { @@ -96,8 +56,6 @@ public function testRunningOnlyNotAssertionFailing() { } finally { $this->assertNotNull($assertionException); $this->assertSame('Failed asserting type "string" does not equal type "string"', $assertionException->getMessage()); - $this->assertSame(__DIR__ . '/Stub/AssertNotTestCase.php', $assertionException->getAssertionFailureFile()); - $this->assertSame(15, $assertionException->getAssertionFailureLine()); } } @@ -115,7 +73,7 @@ public function testRunningCustomAssertions() { /** @var CustomAssertionTestCase $subject */ /** @var AssertionContext $assertionContext */ /** @var CustomAssertionContext $customAssertionContext */ - [$subject, $assertionContext, $_, $customAssertionContext] = $this->getSubjectAndContexts(CustomAssertionTestCase::class); + [$subject, $assertionContext, $customAssertionContext] = $this->getSubjectAndContexts(CustomAssertionTestCase::class); $assertion = $this->getMockBuilder(Assertion::class)->getMock(); $assertResult = $this->getMockBuilder(AssertionResult::class)->getMock(); @@ -134,29 +92,6 @@ public function testRunningCustomAssertions() { $this->assertSame([1,2,3], $state->args); } - public function testRunningCustomAsyncAssertions() { - /** @var CustomAssertionTestCase $subject */ - /** @var AsyncAssertionContext $asyncAssertionContext */ - /** @var CustomAssertionContext $customAssertionContext */ - [$subject, $_, $asyncAssertionContext, $customAssertionContext] = $this->getSubjectAndContexts(CustomAssertionTestCase::class); - - $assertion = $this->getMockBuilder(AsyncAssertion::class)->getMock(); - $assertResult = $this->getMockBuilder(AssertionResult::class)->getMock(); - $assertResult->expects($this->once())->method('isSuccessful')->willReturn(true); - $assertion->expects($this->once())->method('assert')->willReturn(Future::complete($assertResult)); - $state = new \stdClass(); - $state->args = null; - $customAssertionContext->registerAsyncAssertion('myCustomAssertion', function(...$args) use($assertion, $state) { - $state->args = $args; - return $assertion; - }); - - $subject->doCustomAsyncAssertion(); - - $this->assertSame(1, $asyncAssertionContext->getAssertionCount()); - $this->assertSame([1,2,3], $state->args); - } - public function testCreatingMockWithNoBridge() { /** @var MockAwareTestCase $subject */ [$subject] = $this->getSubjectAndContexts(MockAwareTestCase::class); @@ -190,16 +125,11 @@ public function getSubjectAndContexts(string $testCase, MockBridge $mockBridge = $assertionContextConstructor = $reflectedAssertionContext->getConstructor(); $assertionContextConstructor->invoke($assertionContext, $customAssertionContext); - $reflectedAsyncAssertionContext = new \ReflectionClass(AsyncAssertionContext::class); - $asyncAssertionContext = $reflectedAsyncAssertionContext->newInstanceWithoutConstructor(); - $asyncAssertionContextConstructor = $reflectedAsyncAssertionContext->getConstructor(); - $asyncAssertionContextConstructor->invoke($asyncAssertionContext, $customAssertionContext); - $reflectedExpectationContext = new \ReflectionClass(ExpectationContext::class); $fakeTestModel = new TestModel('SomeClass', 'someMethod'); $expectationContext = $reflectedExpectationContext->newInstanceWithoutConstructor(); $expectationContextConstructor = $reflectedExpectationContext->getConstructor(); - $expectationContextConstructor->invoke($expectationContext, $fakeTestModel, $assertionContext, $asyncAssertionContext, $mockBridge); + $expectationContextConstructor->invoke($expectationContext, $fakeTestModel, $assertionContext, $mockBridge); $reflectedSubject = new \ReflectionClass($testCase); $constructor = $reflectedSubject->getConstructor(); @@ -208,11 +138,10 @@ public function getSubjectAndContexts(string $testCase, MockBridge $mockBridge = $subject, (new \ReflectionClass(ImplicitTestSuite::class))->newInstanceWithoutConstructor(), $assertionContext, - $asyncAssertionContext, $expectationContext, $mockBridge ); - return [$subject, $assertionContext, $asyncAssertionContext, $customAssertionContext, $expectationContext]; + return [$subject, $assertionContext, $customAssertionContext, $expectationContext]; } } \ No newline at end of file diff --git a/framework_test/TestSuiteErrorsTest.php b/tests/Unit/Framework/TestSuiteErrorsTest.php similarity index 93% rename from framework_test/TestSuiteErrorsTest.php rename to tests/Unit/Framework/TestSuiteErrorsTest.php index 3b0bfc7..dda52f8 100644 --- a/framework_test/TestSuiteErrorsTest.php +++ b/tests/Unit/Framework/TestSuiteErrorsTest.php @@ -1,13 +1,13 @@ parser = new StaticAnalysisParser(); - $this->emitter = new AmpEventEmitter(); - /** @noinspection PhpFieldAssignmentTypeMismatchInspection */ + $this->emitter = new AmpEmitter(); $this->customAssertionContext = (new ReflectionClass(CustomAssertionContext::class))->newInstanceWithoutConstructor(); - $this->mockBridgeFactory = new NoConstructorMockBridgeFactory($this->getMockBuilder(AutowireableFactory::class)->getMock()); + $this->mockBridgeFactory = new NoConstructorMockBridgeFactory(); $this->testSuiteRunner = new TestSuiteRunner( $this->emitter, $this->customAssertionContext, diff --git a/framework_test/TestSuiteRunnerStatisticsTest.php b/tests/Unit/Framework/TestSuiteRunnerStatisticsTest.php similarity index 69% rename from framework_test/TestSuiteRunnerStatisticsTest.php rename to tests/Unit/Framework/TestSuiteRunnerStatisticsTest.php index 854dfdc..a8674c6 100644 --- a/framework_test/TestSuiteRunnerStatisticsTest.php +++ b/tests/Unit/Framework/TestSuiteRunnerStatisticsTest.php @@ -1,25 +1,24 @@ buildTestSuiteRunner(); } - private function createEventRecordingListener(string $event) : Listener { - return new class($event) extends AbstractListener { + private function createEventRecordingListener() : Listener { + return new class() implements Listener { public array $actual = []; - public function __construct( - private readonly string $event - ) {} - - public function canHandle(string $eventName) : bool { - return $this->event === $eventName; - } - public function handle(Event $event) : Future|CompositeFuture|null { $this->actual[] = $event; return null; @@ -52,8 +43,8 @@ public function handle(Event $event) : Future|CompositeFuture|null { public function testTestProcessingStartedHasAggregateSummary() { $results = $this->parser->parse($this->implicitDefaultTestSuitePath('TestCaseDisabled')); - $listener = $this->createEventRecordingListener(Events::PROCESSING_STARTED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_STARTED, $listener); $this->testSuiteRunner->runTestSuites($results); @@ -62,7 +53,7 @@ public function testTestProcessingStartedHasAggregateSummary() { $testStartedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingStartedEvent::class, $testStartedEvent); - $this->assertInstanceOf(AggregateSummary::class, $testStartedEvent->getTarget()); + $this->assertInstanceOf(AggregateSummary::class, $testStartedEvent->payload()); } public function processedAggregateSummaryTestSuiteInfoProvider() : array { @@ -79,8 +70,8 @@ public function processedAggregateSummaryTestSuiteInfoProvider() : array { */ public function testTestProcessingFinishedHasProcessedAggregateSummaryWithCorrectTestSuiteNames(string $path, array $expected) { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); @@ -89,7 +80,7 @@ public function testTestProcessingFinishedHasProcessedAggregateSummaryWithCorrec $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $summary = $testFinishedEvent->getTarget(); + $summary = $testFinishedEvent->payload(); $this->assertEqualsCanonicalizing( $expected, @@ -109,8 +100,8 @@ public function processedAggregateSummaryWithCorrectTotalTestSuiteCountProvider( */ public function testProcessedAggregateSummaryWithCorrectTotalTestSuiteCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); @@ -118,7 +109,7 @@ public function testProcessedAggregateSummaryWithCorrectTotalTestSuiteCount(stri $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getTotalTestSuiteCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getTotalTestSuiteCount()); } @@ -135,15 +126,15 @@ public function processedAggregateSummaryWithCorrectDisabledTestSuiteCountProvid */ public function testProcessedAggregateSummaryWithCorrectDisabledTestSuiteCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertCount(1, $listener->actual); $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getDisabledTestSuiteCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getDisabledTestSuiteCount()); } public function processedAggregateSummaryWithCorrectTotalTestCaseCountProvider() : array { @@ -159,15 +150,15 @@ public function processedAggregateSummaryWithCorrectTotalTestCaseCountProvider() */ public function testProcessedAggregateSummaryWithCorrectTotalTestCaseCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertCount(1, $listener->actual); $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getTotalTestCaseCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getTotalTestCaseCount()); } public function processedAggregateSummaryWithCorrectDisabledTestCaseCountProvider() : array { @@ -184,8 +175,8 @@ public function processedAggregateSummaryWithCorrectDisabledTestCaseCountProvide */ public function testProcessedAggregateSummaryWithCorrectDisabledTestCaseCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertCount(1, $listener->actual); @@ -193,7 +184,7 @@ public function testProcessedAggregateSummaryWithCorrectDisabledTestCaseCount(st $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getDisabledTestCaseCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getDisabledTestCaseCount()); } public function processedAggregateSummaryWithCorrectTotalTestCountProvider() : array { @@ -211,8 +202,8 @@ public function processedAggregateSummaryWithCorrectTotalTestCountProvider() : a */ public function testProcessedAggregateSummaryWithCorrectTotalTestCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertCount(1, $listener->actual); @@ -220,7 +211,7 @@ public function testProcessedAggregateSummaryWithCorrectTotalTestCount(string $p $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getTotalTestCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getTotalTestCount()); } public function processedAggregateSummaryWithCorrectDisabledTestCountProvider() : array { @@ -238,8 +229,8 @@ public function processedAggregateSummaryWithCorrectDisabledTestCountProvider() */ public function testProcessedAggregateSummaryWithCorrectDisabledTestCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertCount(1, $listener->actual); @@ -247,7 +238,7 @@ public function testProcessedAggregateSummaryWithCorrectDisabledTestCount(string $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getDisabledTestCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getDisabledTestCount()); } public function processedAggregateSummaryWithCorrectPassedTestCountProvider() : array { @@ -265,8 +256,8 @@ public function processedAggregateSummaryWithCorrectPassedTestCountProvider() : */ public function testProcessedAggregateSummaryWithCorrectPassedTestCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertCount(1, $listener->actual); @@ -274,7 +265,7 @@ public function testProcessedAggregateSummaryWithCorrectPassedTestCount(string $ $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getPassedTestCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getPassedTestCount()); } public function processedAggregateSummaryWithCorrectFailedTestCountProvider() : array { @@ -293,15 +284,15 @@ public function processedAggregateSummaryWithCorrectFailedTestCountProvider() : */ public function testProcessedAggregateSummaryWithCorrectFailedTestCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertCount(1, $listener->actual); $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getFailedTestCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getFailedTestCount()); } public function processedAggregateSummaryWithCorrectErroredTestCountProvider() : array { @@ -320,8 +311,8 @@ public function processedAggregateSummaryWithCorrectErroredTestCountProvider() : */ public function testProcessedAggregateSummaryWithCorrectErroredTestCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertCount(1, $listener->actual); @@ -329,15 +320,15 @@ public function testProcessedAggregateSummaryWithCorrectErroredTestCount(string $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getErroredTestCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getErroredTestCount()); } public function processedAggregateSummaryWithCorrectAssertionCountProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), 1], - [$this->implicitDefaultTestSuitePath('MultipleTest'), 3], - [$this->implicitDefaultTestSuitePath('KitchenSink'), 4], - [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), 18] + 'SingleTest' => [$this->implicitDefaultTestSuitePath('SingleTest'), 1], + 'MultipleTest' => [$this->implicitDefaultTestSuitePath('MultipleTest'), 3], + 'KitchenSink' => [$this->implicitDefaultTestSuitePath('KitchenSink'), 10], + 'ExtendedTestCases' => [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), 22] ]; } @@ -346,34 +337,8 @@ public function processedAggregateSummaryWithCorrectAssertionCountProvider() : a */ public function testProcessedAggregateSummaryWithCorrectAssertionCount(string $path, int $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); - $this->testSuiteRunner->runTestSuites($results); - - $this->assertCount(1, $listener->actual); - /** @var ProcessingFinishedEvent $testFinishedEvent */ - $testFinishedEvent = $listener->actual[0]; - - $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getAssertionCount()); - } - - public function processedAggregateSummaryWithCorrectAsyncAssertionCountProvider() : array { - return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), 0], - [$this->implicitDefaultTestSuitePath('MultipleTest'), 0], - [$this->implicitDefaultTestSuitePath('KitchenSink'), 6], - [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), 4] - ]; - } - - /** - * @dataProvider processedAggregateSummaryWithCorrectAsyncAssertionCountProvider - */ - public function testProcessedAggregateSummaryWithCorrectAsyncAssertionCount(string $path, int $expected) : void { - $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertCount(1, $listener->actual); @@ -381,13 +346,13 @@ public function testProcessedAggregateSummaryWithCorrectAsyncAssertionCount(stri $testFinishedEvent = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $testFinishedEvent); - $this->assertSame($expected, $testFinishedEvent->getTarget()->getAsyncAssertionCount()); + $this->assertSame($expected, $testFinishedEvent->payload()->getAssertionCount()); } public function processedTestSuiteSummaryTestSuiteNameProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), [ImplicitTestSuite::class]], - [$this->implicitDefaultTestSuitePath('KitchenSink'), [ + 'SingleTest' => [$this->implicitDefaultTestSuitePath('SingleTest'), [ImplicitTestSuite::class]], + 'KitchenSink' => [$this->implicitDefaultTestSuitePath('KitchenSink'), [ ImplicitTestSuite::class, ImplicitDefaultTestSuite\KitchenSink\FirstTestSuite::class, ImplicitDefaultTestSuite\KitchenSink\WhatAbout\PotatoTestSuite::class @@ -400,22 +365,22 @@ public function processedTestSuiteSummaryTestSuiteNameProvider() : array { */ public function testProcessedTestSuiteSummaryHasCorrectTestSuiteName(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $this->assertEqualsCanonicalizing( $expected, - array_map(static fn(Event $event) => $event->getTarget()->getTestSuiteName(), $listener->actual) + array_map(static fn(Event $event) => $event->payload()->getTestSuiteName(), $listener->actual) ); } public function processedTestSuiteSummaryTestCaseNamesProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), [ + 'SingleTest' => [$this->implicitDefaultTestSuitePath('SingleTest'), [ ImplicitTestSuite::class => [ImplicitDefaultTestSuite\SingleTest\MyTestCase::class] ]], - [$this->implicitDefaultTestSuitePath('KitchenSink'), [ + 'KitchenSink' => [$this->implicitDefaultTestSuitePath('KitchenSink'), [ ImplicitDefaultTestSuite\KitchenSink\FirstTestSuite::class => [ ImplicitDefaultTestSuite\KitchenSink\FirstTestCase::class, ImplicitDefaultTestSuite\KitchenSink\SecondTestCase::class, @@ -430,7 +395,7 @@ public function processedTestSuiteSummaryTestCaseNamesProvider() : array { ImplicitDefaultTestSuite\KitchenSink\SecondBreakfast\BadTestCase::class ] ]], - [$this->explicitTestSuitePath('TestSuiteDisabled'), [ + 'TestSuiteDisabled' => [$this->explicitTestSuitePath('TestSuiteDisabled'), [ ExplicitTestSuite\TestSuiteDisabled\MyTestSuite::class => [ ExplicitTestSuite\TestSuiteDisabled\FirstTestCase::class, ExplicitTestSuite\TestSuiteDisabled\SecondTestCase::class @@ -444,13 +409,13 @@ public function processedTestSuiteSummaryTestCaseNamesProvider() : array { */ public function testProcessedTestSuiteSummaryHasTestCaseNames(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getTestCaseNames(); + $actual[$event->payload()->getTestSuiteName()] = $event->payload()->getTestCaseNames(); } $testSuites = array_keys($actual); @@ -466,17 +431,17 @@ public function testProcessedTestSuiteSummaryHasTestCaseNames(string $path, arra public function processedTestSuiteSummaryTotalTestCaseCountProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), [ + 'SingleTest' => [$this->implicitDefaultTestSuitePath('SingleTest'), [ ImplicitTestSuite::class => 1, ]], - [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ + 'ExtendedTestCases' => [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ ImplicitTestSuite::class => 3 ]], - [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ + 'TestCaseDefinesTestSuite' => [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ ExplicitTestSuite\TestCaseDefinesTestSuite\MyFirstTestSuite::class => 1, ExplicitTestSuite\TestCaseDefinesTestSuite\MySecondTestSuite::class => 2 ]], - [$this->explicitTestSuitePath('TestSuiteDisabled'), [ + 'TestSuiteDisabled' => [$this->explicitTestSuitePath('TestSuiteDisabled'), [ ExplicitTestSuite\TestSuiteDisabled\MyTestSuite::class => 2 ]] ]; @@ -487,13 +452,13 @@ public function processedTestSuiteSummaryTotalTestCaseCountProvider() : array { */ public function testProcessedTestSuiteSummaryHasTotalTestCaseCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getTestCaseCount(); + $actual[$event->payload()->getTestSuiteName()] = $event->payload()->getTestCaseCount(); } $this->assertEquals($expected, $actual); @@ -501,17 +466,17 @@ public function testProcessedTestSuiteSummaryHasTotalTestCaseCount(string $path, public function processedTestSuiteSummaryDisabledTestCaseCountProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), [ + 'SingleTest' => [$this->implicitDefaultTestSuitePath('SingleTest'), [ ImplicitTestSuite::class => 0, ]], - [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ + 'TestCaseDisabled' => [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ ImplicitTestSuite::class => 1 ]], - [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ + 'TestCaseDefinesTestSuite' => [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ ExplicitTestSuite\TestCaseDefinesTestSuite\MyFirstTestSuite::class => 0, ExplicitTestSuite\TestCaseDefinesTestSuite\MySecondTestSuite::class => 0 ]], - [$this->explicitTestSuitePath('TestSuiteDisabled'), [ + 'TestSuiteDisabled' => [$this->explicitTestSuitePath('TestSuiteDisabled'), [ ExplicitTestSuite\TestSuiteDisabled\MyTestSuite::class => 2 ]] ]; @@ -522,13 +487,13 @@ public function processedTestSuiteSummaryDisabledTestCaseCountProvider() : array */ public function testProcessedTestSuiteSummaryHasDisabledTestCaseCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getDisabledTestCaseCount(); + $actual[$event->payload()->getTestSuiteName()] = $event->payload()->getDisabledTestCaseCount(); } $this->assertEquals($expected, $actual); @@ -563,13 +528,13 @@ public function processedTestSuiteSummaryTotalTestCountProvider() : array { */ public function testProcessedTestSuiteSummaryHasTotalTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getTestCount(); + $actual[$event->payload()->getTestSuiteName()] = $event->payload()->getTestCount(); } $this->assertEquals($expected, $actual); @@ -577,23 +542,23 @@ public function testProcessedTestSuiteSummaryHasTotalTestCount(string $path, arr public function processedTestSuiteSummaryDisabledTestCountProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), [ + 'SingleTest' => [$this->implicitDefaultTestSuitePath('SingleTest'), [ ImplicitTestSuite::class => 0, ]], - [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ + 'TestCaseDisabled' => [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ ImplicitTestSuite::class => 3 ]], - [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ + 'TestCaseDefinesTestSuite' => [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ ExplicitTestSuite\TestCaseDefinesTestSuite\MyFirstTestSuite::class => 0, ExplicitTestSuite\TestCaseDefinesTestSuite\MySecondTestSuite::class => 0 ]], - [$this->explicitTestSuitePath('TestSuiteDisabled'), [ + 'TestSuiteDisabled' => [$this->explicitTestSuitePath('TestSuiteDisabled'), [ ExplicitTestSuite\TestSuiteDisabled\MyTestSuite::class => 3 ]], - [$this->implicitDefaultTestSuitePath('TestDisabled'), [ + 'TestDisabled' => [$this->implicitDefaultTestSuitePath('TestDisabled'), [ ImplicitTestSuite::class => 1 ]], - [$this->implicitDefaultTestSuitePath('ExceptionThrowingTest'), [ + 'ExceptionThrowingTest' => [$this->implicitDefaultTestSuitePath('ExceptionThrowingTest'), [ ImplicitTestSuite::class => 0 ]] ]; @@ -604,13 +569,13 @@ public function processedTestSuiteSummaryDisabledTestCountProvider() : array { */ public function testProcessedTestSuiteSummaryHasDisabledTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getDisabledTestCount(); + $actual[$event->payload()->getTestSuiteName()] = $event->payload()->getDisabledTestCount(); } $this->assertEquals($expected, $actual); @@ -618,17 +583,17 @@ public function testProcessedTestSuiteSummaryHasDisabledTestCount(string $path, public function processedTestSuiteSummaryPassedTestCountProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), [ImplicitTestSuite::class => 1,]], - [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ImplicitTestSuite::class => 0]], - [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ + 'SingleTest' => [$this->implicitDefaultTestSuitePath('SingleTest'), [ImplicitTestSuite::class => 1,]], + 'TestCaseDisabled' => [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ImplicitTestSuite::class => 0]], + 'TestCaseDefinesTestSuite' => [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ ExplicitTestSuite\TestCaseDefinesTestSuite\MyFirstTestSuite::class => 1, ExplicitTestSuite\TestCaseDefinesTestSuite\MySecondTestSuite::class => 2 ]], - [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ImplicitTestSuite::class => 8]], - [$this->implicitDefaultTestSuitePath('TestDisabled'), [ + 'ExtendedTestCases' => [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ImplicitTestSuite::class => 8]], + 'TestDisabled' => [$this->implicitDefaultTestSuitePath('TestDisabled'), [ ImplicitTestSuite::class => 1 ]], - [$this->implicitDefaultTestSuitePath('ExceptionThrowingTest'), [ + 'ExceptionThrowingTest' => [$this->implicitDefaultTestSuitePath('ExceptionThrowingTest'), [ ImplicitTestSuite::class => 0 ]] ]; @@ -639,13 +604,13 @@ public function processedTestSuiteSummaryPassedTestCountProvider() : array { */ public function testProcessedTestSuiteSummaryHasPassedTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getPassedTestCount(); + $actual[$event->payload()->getTestSuiteName()] = $event->payload()->getPassedTestCount(); } $this->assertEquals($expected, $actual); @@ -653,15 +618,15 @@ public function testProcessedTestSuiteSummaryHasPassedTestCount(string $path, ar public function processedTestSuiteSummaryFailedTestCountProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('FailedAssertion'), [ImplicitTestSuite::class => 1,]], - [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ImplicitTestSuite::class => 0]], - [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ + 'FailedAssertion' => [$this->implicitDefaultTestSuitePath('FailedAssertion'), [ImplicitTestSuite::class => 1,]], + 'TestCaseDisabled' => [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ImplicitTestSuite::class => 0]], + 'TestCaseDefinesTestSuite' => [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ ExplicitTestSuite\TestCaseDefinesTestSuite\MyFirstTestSuite::class => 0, ExplicitTestSuite\TestCaseDefinesTestSuite\MySecondTestSuite::class => 0 ]], - [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ImplicitTestSuite::class => 1]], - [$this->implicitDefaultTestSuitePath('FailedNotAssertion'), [ImplicitTestSuite::class => 1]], - [$this->implicitDefaultTestSuitePath('ExceptionThrowingTest'), [ImplicitTestSuite::class => 0]] + 'ExtendedTestCases' => [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ImplicitTestSuite::class => 1]], + 'FailedNotAssertion' => [$this->implicitDefaultTestSuitePath('FailedNotAssertion'), [ImplicitTestSuite::class => 1]], + 'ExceptionThrowingTest' => [$this->implicitDefaultTestSuitePath('ExceptionThrowingTest'), [ImplicitTestSuite::class => 0]] ]; } @@ -670,13 +635,13 @@ public function processedTestSuiteSummaryFailedTestCountProvider() : array { */ public function testProcessedTestSuiteSummaryHasFailedTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getFailedTestCount(); + $actual[$event->payload()->getTestSuiteName()] = $event->payload()->getFailedTestCount(); } $this->assertEquals($expected, $actual); @@ -684,15 +649,15 @@ public function testProcessedTestSuiteSummaryHasFailedTestCount(string $path, ar public function processedTestSuiteSummaryErroredTestCountProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('FailedAssertion'), [ImplicitTestSuite::class => 0]], - [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ImplicitTestSuite::class => 0]], - [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ + 'FailedAssertion' => [$this->implicitDefaultTestSuitePath('FailedAssertion'), [ImplicitTestSuite::class => 0]], + 'TestCaseDisabled' => [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ImplicitTestSuite::class => 0]], + 'TestCaseDefinesTestSuite' => [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ ExplicitTestSuite\TestCaseDefinesTestSuite\MyFirstTestSuite::class => 0, ExplicitTestSuite\TestCaseDefinesTestSuite\MySecondTestSuite::class => 0 ]], - [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ImplicitTestSuite::class => 0]], - [$this->implicitDefaultTestSuitePath('FailedNotAssertion'), [ImplicitTestSuite::class => 0]], - [$this->implicitDefaultTestSuitePath('ExceptionThrowingTest'), [ImplicitTestSuite::class => 1]] + 'ExtendedTestCases' => [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ImplicitTestSuite::class => 0]], + 'FailedNotAssertion' => [$this->implicitDefaultTestSuitePath('FailedNotAssertion'), [ImplicitTestSuite::class => 0]], + 'ExceptionThrowingTest' => [$this->implicitDefaultTestSuitePath('ExceptionThrowingTest'), [ImplicitTestSuite::class => 1]] ]; } @@ -701,13 +666,13 @@ public function processedTestSuiteSummaryErroredTestCountProvider() : array { */ public function testProcessedTestSuiteSummaryHasErroredTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getErroredTestCount(); + $actual[$event->payload()->getTestSuiteName()] = $event->payload()->getErroredTestCount(); } $this->assertEquals($expected, $actual); @@ -715,14 +680,14 @@ public function testProcessedTestSuiteSummaryHasErroredTestCount(string $path, a public function processedTestSuiteSummaryAssertionCountProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('FailedAssertion'), [ImplicitTestSuite::class => 1,]], - [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ImplicitTestSuite::class => 0]], - [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ + 'FailedAssertion' => [$this->implicitDefaultTestSuitePath('FailedAssertion'), [ImplicitTestSuite::class => 1,]], + 'TestCaseDisabled' => [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ImplicitTestSuite::class => 0]], + 'TestCaseDefinesTestSuite' => [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ ExplicitTestSuite\TestCaseDefinesTestSuite\MyFirstTestSuite::class => 1, - ExplicitTestSuite\TestCaseDefinesTestSuite\MySecondTestSuite::class => 1 + ExplicitTestSuite\TestCaseDefinesTestSuite\MySecondTestSuite::class => 2 ]], - [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ImplicitTestSuite::class => 18]], - [$this->implicitDefaultTestSuitePath('FailedNotAssertion'), [ImplicitTestSuite::class => 1]] + 'ExtendedTestCases' => [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ImplicitTestSuite::class => 22]], + 'FailedNotAssertion' => [$this->implicitDefaultTestSuitePath('FailedNotAssertion'), [ImplicitTestSuite::class => 1]] ]; } @@ -731,43 +696,13 @@ public function processedTestSuiteSummaryAssertionCountProvider() : array { */ public function testProcessedTestSuiteSummaryHasAssertionCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getAssertionCount(); - } - - $this->assertEquals($expected, $actual); - } - - public function processedTestSuiteSummaryAsyncAssertionCountProvider() : array { - return [ - [$this->implicitDefaultTestSuitePath('FailedAssertion'), [ImplicitTestSuite::class => 0,]], - [$this->implicitDefaultTestSuitePath('TestCaseDisabled'), [ImplicitTestSuite::class => 0]], - [$this->explicitTestSuitePath('TestCaseDefinesTestSuite'), [ - ExplicitTestSuite\TestCaseDefinesTestSuite\MyFirstTestSuite::class => 0, - ExplicitTestSuite\TestCaseDefinesTestSuite\MySecondTestSuite::class => 1 - ]], - [$this->implicitDefaultTestSuitePath('ExtendedTestCases'), [ImplicitTestSuite::class => 4]], - [$this->implicitDefaultTestSuitePath('SingleTestAsyncAssertion'), [ImplicitTestSuite::class => 1]] - ]; - } - - /** - * @dataProvider processedTestSuiteSummaryAsyncAssertionCountProvider - */ - public function testProcessedTestSuiteSummaryHasAsyncAssertionCount(string $path, array $expected) : void { - $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); - $this->testSuiteRunner->runTestSuites($results); - - $actual = []; - foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestSuiteName()] = $event->getTarget()->getAsyncAssertionCount(); + $actual[$event->payload()->getTestSuiteName()] = $event->payload()->getAssertionCount(); } $this->assertEquals($expected, $actual); @@ -775,10 +710,10 @@ public function testProcessedTestSuiteSummaryHasAsyncAssertionCount(string $path public function processedTestCaseSummaryTestSuiteNameProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), [ + 'SingleTest' => [$this->implicitDefaultTestSuitePath('SingleTest'), [ ImplicitDefaultTestSuite\SingleTest\MyTestCase::class => ImplicitTestSuite::class ]], - [$this->implicitDefaultTestSuitePath('KitchenSink'), [ + 'KitchenSink' => [$this->implicitDefaultTestSuitePath('KitchenSink'), [ ImplicitDefaultTestSuite\KitchenSink\FirstTestCase::class => ImplicitDefaultTestSuite\KitchenSink\FirstTestSuite::class, ImplicitDefaultTestSuite\KitchenSink\SecondTestCase::class => ImplicitDefaultTestSuite\KitchenSink\FirstTestSuite::class, ImplicitDefaultTestSuite\KitchenSink\WhatAbout\SamwiseTestCase::class => ImplicitDefaultTestSuite\KitchenSink\WhatAbout\PotatoTestSuite::class, @@ -795,14 +730,14 @@ public function processedTestCaseSummaryTestSuiteNameProvider() : array { */ public function testProcessedTestCaseSummaryHasCorrectTestSuiteName(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_CASE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getTestSuiteName(); + $actual[$event->payload()->getTestCaseName()] = $event->payload()->getTestSuiteName(); } ksort($expected); @@ -854,13 +789,13 @@ public function processedTestCaseSummaryTestNamesProvider() : array { */ public function testProcessedTestCaseSummaryHasCorrectTestNames(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_CASE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getTestNames(); + $actual[$event->payload()->getTestCaseName()] = $event->payload()->getTestNames(); } ksort($expected); @@ -893,13 +828,13 @@ public function processedTestCaseSummaryTestCountProvider() : array { */ public function testProcessedTestCaseSummaryHasCorrectTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_CASE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getTestCount(); + $actual[$event->payload()->getTestCaseName()] = $event->payload()->getTestCount(); } ksort($expected); @@ -932,13 +867,13 @@ public function processedTestCaseSummaryDisabledTestCountProvider() : array { */ public function testProcessedTestCaseSummaryHasCorrectDisabledTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_CASE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getDisabledTestCount(); + $actual[$event->payload()->getTestCaseName()] = $event->payload()->getDisabledTestCount(); } ksort($expected); @@ -971,13 +906,13 @@ public function processedTestCaseSummaryPassedTestCountProvider() : array { */ public function testProcessedTestCaseSummaryHasCorrectPassedTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_CASE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getPassedTestCount(); + $actual[$event->payload()->getTestCaseName()] = $event->payload()->getPassedTestCount(); } ksort($expected); @@ -1013,13 +948,13 @@ public function processedTestCaseSummaryFailedTestCountProvider() : array { */ public function testProcessedTestCaseSummaryHasCorrectFailedTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_CASE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getFailedTestCount(); + $actual[$event->payload()->getTestCaseName()] = $event->payload()->getFailedTestCount(); } ksort($expected); @@ -1055,13 +990,13 @@ public function processedTestCaseSummaryErroredTestCountProvider() : array { */ public function testProcessedTestCaseSummaryHasCorrectErroredTestCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_CASE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getErroredTestCount(); + $actual[$event->payload()->getTestCaseName()] = $event->payload()->getErroredTestCount(); } ksort($expected); @@ -1071,19 +1006,19 @@ public function testProcessedTestCaseSummaryHasCorrectErroredTestCount(string $p public function processedTestCaseSummaryAssertionCountProvider() : array { return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), [ + 'SingleTest' => [$this->implicitDefaultTestSuitePath('SingleTest'), [ ImplicitDefaultTestSuite\SingleTest\MyTestCase::class => 1 ]], - [$this->implicitDefaultTestSuitePath('FailedAssertion'), [ + 'FailedAssertion' => [$this->implicitDefaultTestSuitePath('FailedAssertion'), [ ImplicitDefaultTestSuite\FailedAssertion\MyTestCase::class => 1, ]], - [$this->implicitDefaultTestSuitePath('KitchenSink'), [ - ImplicitDefaultTestSuite\KitchenSink\FirstTestCase::class => 1, - ImplicitDefaultTestSuite\KitchenSink\SecondTestCase::class =>1, + 'KitchenSink' => [$this->implicitDefaultTestSuitePath('KitchenSink'), [ + ImplicitDefaultTestSuite\KitchenSink\FirstTestCase::class => 2, + ImplicitDefaultTestSuite\KitchenSink\SecondTestCase::class => 2, ImplicitDefaultTestSuite\KitchenSink\WhatAbout\SamwiseTestCase::class => 1, ImplicitDefaultTestSuite\KitchenSink\WhatAbout\FrodoTestCase::class => 1, ImplicitDefaultTestSuite\KitchenSink\WhatAbout\BilboTestCase::class => 0, - ImplicitDefaultTestSuite\KitchenSink\SecondBreakfast\FoodAndBeverageTestCase::class => 0, + ImplicitDefaultTestSuite\KitchenSink\SecondBreakfast\FoodAndBeverageTestCase::class => 4, ImplicitDefaultTestSuite\KitchenSink\SecondBreakfast\BadTestCase::class => 0 ]] ]; @@ -1094,52 +1029,13 @@ public function processedTestCaseSummaryAssertionCountProvider() : array { */ public function testProcessedTestCaseSummaryHasCorrectAssertionCount(string $path, array $expected) : void { $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); - $this->testSuiteRunner->runTestSuites($results); - - $actual = []; - foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getAssertionCount(); - } - - ksort($expected); - ksort($actual); - $this->assertEquals($expected, $actual); - } - - public function processedTestCaseSummaryAsyncAssertionCountProvider() : array { - return [ - [$this->implicitDefaultTestSuitePath('SingleTest'), [ - ImplicitDefaultTestSuite\SingleTest\MyTestCase::class => 0 - ]], - [$this->implicitDefaultTestSuitePath('SingleTestAsyncAssertion'), [ - ImplicitDefaultTestSuite\SingleTestAsyncAssertion\MyTestCase::class => 1, - ]], - [$this->implicitDefaultTestSuitePath('KitchenSink'), [ - ImplicitDefaultTestSuite\KitchenSink\FirstTestCase::class => 1, - ImplicitDefaultTestSuite\KitchenSink\SecondTestCase::class =>1, - ImplicitDefaultTestSuite\KitchenSink\WhatAbout\SamwiseTestCase::class => 0, - ImplicitDefaultTestSuite\KitchenSink\WhatAbout\FrodoTestCase::class => 0, - ImplicitDefaultTestSuite\KitchenSink\WhatAbout\BilboTestCase::class => 0, - ImplicitDefaultTestSuite\KitchenSink\SecondBreakfast\FoodAndBeverageTestCase::class => 4, - ImplicitDefaultTestSuite\KitchenSink\SecondBreakfast\BadTestCase::class => 0 - ]] - ]; - } - - /** - * @dataProvider processedTestCaseSummaryAsyncAssertionCountProvider - */ - public function testProcessedTestCaseSummaryHasCorrectAsyncAssertionCount(string $path, array $expected) : void { - $results = $this->parser->parse($path); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_CASE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getAsyncAssertionCount(); + $actual[$event->payload()->getTestCaseName()] = $event->payload()->getAssertionCount(); } ksort($expected); @@ -1149,32 +1045,32 @@ public function testProcessedTestCaseSummaryHasCorrectAsyncAssertionCount(string public function testProcessedAggregateSummaryHasDuration() { $results = $this->parser->parse($this->implicitDefaultTestSuitePath('MultipleTestsKnownDuration')); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); self::assertCount(1, $listener->actual); $event = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $event); - $this->assertGreaterThan(600, $event->getTarget()->getDuration()->asMilliseconds()); + $this->assertGreaterThan(600, $event->payload()->getDuration()->asMilliseconds()); } public function testTestSuiteSummaryHasDuration() : void { $results = $this->parser->parse($this->implicitDefaultTestSuitePath('MultipleTestsKnownDuration')); - $listener = $this->createEventRecordingListener(Events::TEST_SUITE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_SUITE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); self::assertCount(1, $listener->actual); $event = $listener->actual[0]; $this->assertInstanceOf(TestSuiteFinishedEvent::class, $event); - $this->assertGreaterThan(600, $event->getTarget()->getDuration()->asMilliseconds()); + $this->assertGreaterThan(600, $event->payload()->getDuration()->asMilliseconds()); } public function testTestCaseSummaryHasDuration() : void { $results = $this->parser->parse($this->implicitDefaultTestSuitePath('MultipleTestsKnownDuration')); - $listener = $this->createEventRecordingListener(Events::TEST_CASE_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_CASE_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); $expected = [ @@ -1185,7 +1081,7 @@ public function testTestCaseSummaryHasDuration() : void { $actual = []; foreach ($listener->actual as $event) { - $actual[$event->getTarget()->getTestCaseName()] = $event->getTarget()->getDuration()->asMilliseconds(); + $actual[$event->payload()->getTestCaseName()] = $event->payload()->getDuration()->asMilliseconds(); } foreach ($expected as $testCase => $duration) { @@ -1195,14 +1091,14 @@ public function testTestCaseSummaryHasDuration() : void { public function testTestResultHasDuration() : void { $results = $this->parser->parse($this->implicitDefaultTestSuitePath('MultipleTestsKnownDuration')); - $listener = $this->createEventRecordingListener(Events::TEST_PROCESSED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_PROCESSED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $key = $event->getTarget()->getTestCase()::class . '::' . $event->getTarget()->getTestMethod(); - $actual[$key] = $event->getTarget()->getDuration()->asMilliseconds(); + $key = $event->payload()->getTestCase()::class . '::' . $event->payload()->getTestMethod(); + $actual[$key] = $event->payload()->getDuration()->asMilliseconds(); } $expected = [ @@ -1221,13 +1117,13 @@ public function testTestResultHasDuration() : void { public function testDisabledTestHasZeroDuration() : void { $results = $this->parser->parse($this->implicitDefaultTestSuitePath('TestDisabled')); - $listener = $this->createEventRecordingListener(Events::TEST_DISABLED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_DISABLED, $listener); $this->testSuiteRunner->runTestSuites($results); $actual = []; foreach ($listener->actual as $event) { - $actual[] = $event->getTarget()->getDuration()->asMilliseconds(); + $actual[] = $event->payload()->getDuration()->asMilliseconds(); } $this->assertCount(1, $actual); @@ -1236,27 +1132,26 @@ public function testDisabledTestHasZeroDuration() : void { public function testProcessedAggregateSummaryHasMemoryUsageInBytes() { $results = $this->parser->parse($this->implicitDefaultTestSuitePath('SingleTest')); - $listener = $this->createEventRecordingListener(Events::PROCESSING_FINISHED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::PROCESSING_FINISHED, $listener); $this->testSuiteRunner->runTestSuites($results); self::assertCount(1, $listener->actual); $event = $listener->actual[0]; $this->assertInstanceOf(ProcessingFinishedEvent::class, $event); - $this->assertGreaterThan(1000, $event->getTarget()->getMemoryUsageInBytes()); + $this->assertGreaterThan(1000, $event->payload()->getMemoryUsageInBytes()); } public function testTestCaseSummaryMockBridgeAssertionCount() { - $this->markTestSkipped('Need to reimplement MockBridge.'); $results = $this->parser->parse($this->implicitDefaultTestSuitePath('MockeryTestNoAssertion')); - $listener = $this->createEventRecordingListener(Events::TEST_PROCESSED); - $this->emitter->register($listener); + $listener = $this->createEventRecordingListener(); + $this->emitter->register(Events::TEST_PROCESSED, $listener); $this->testSuiteRunner->setMockBridgeClass(MockeryMockBridge::class); $this->testSuiteRunner->runTestSuites($results); self::assertCount(1, $listener->actual); $event = $listener->actual[0]; $this->assertInstanceOf(TestProcessedEvent::class, $event); - $this->assertEquals(1, $event->getTarget()->getTestCase()->getAssertionCount()); + $this->assertEquals(1, $event->payload()->getTestCase()->getAssertionCount()); } } diff --git a/framework_test/TestSuiteRunnerTest.php b/tests/Unit/Framework/TestSuiteRunnerTest.php similarity index 88% rename from framework_test/TestSuiteRunnerTest.php rename to tests/Unit/Framework/TestSuiteRunnerTest.php index 0e02d24..9edc09a 100644 --- a/framework_test/TestSuiteRunnerTest.php +++ b/tests/Unit/Framework/TestSuiteRunnerTest.php @@ -1,23 +1,30 @@ buildTestSuiteRunner(); - $this->listener = new class extends AbstractListener { + $this->listener = new class implements Listener { private array $targets = []; - public function canHandle(string $eventName) : bool { - return $eventName === Events::TEST_PROCESSED; - } - public function handle(Event $event) : Future|CompositeFuture|null { - $this->targets[] = $event->getTarget(); + $this->targets[] = $event->payload(); return null; } @@ -48,7 +51,7 @@ public function getTargets() : array { return $this->targets; } }; - $this->emitter->register($this->listener); + $this->emitter->register(Events::TEST_PROCESSED, $this->listener); } public function tearDown(): void { @@ -60,20 +63,12 @@ private function parseAndRun(string $path) : void { $this->testSuiteRunner->runTestSuites($results); } - private function createRecordingListener(array $events) : Listener { - return new class($events) extends AbstractListener { + private function createRecordingListener() : Listener { + return new class() implements Listener{ public array $actual = []; - public function __construct( - private readonly array $events - ) {} - - public function canHandle(string $eventName) : bool { - return in_array($eventName, $this->events, true); - } - public function handle(Event $event) : Future|CompositeFuture|null { - $this->actual[] = $event->getName(); + $this->actual[] = $event->name(); return null; } }; @@ -219,13 +214,7 @@ public function testImplicitDefaultTestSuiteCustomAssertionsEmitsTestProcessedEv $assertionResult->expects($this->once())->method('isSuccessful')->willReturn(true); $assertion->expects($this->once())->method('assert')->willReturn($assertionResult); - $asyncAssertion = $this->getMockBuilder(AsyncAssertion::class)->getMock(); - $asyncAssertionResult = $this->getMockBuilder(AssertionResult::class)->getMock(); - $asyncAssertionResult->expects($this->once())->method('isSuccessful')->willReturn(true); - $asyncAssertion->expects($this->once())->method('assert')->willReturn(Future::complete($asyncAssertionResult)); - $this->customAssertionContext->registerAssertion('theCustomAssertion', fn() => $assertion); - $this->customAssertionContext->registerAsyncAssertion('theCustomAssertion', fn() => $asyncAssertion); // Normal TestSuiteRunner testing $this->parseAndRun($this->implicitDefaultTestSuitePath('CustomAssertions')); @@ -252,7 +241,7 @@ public function testExplicitTestSuiteDefaultExplicitTestSuite() { $this->parseAndRun($this->explicitTestSuitePath('AnnotatedDefaultTestSuite')); $this->assertCount(1, $this->listener->getTargets()); - $this->assertSame(ExplicitTestSuite\AnnotatedDefaultTestSuite\MyTestSuite::class, $this->listener->getTargets()[0]->getTestCase()->testSuite()::class); + $this->assertSame(ExplicitTestSuite\AnnotatedDefaultTestSuite\MyTestSuite::class, $this->listener->getTargets()[0]->getTestCase()->testSuite::class); } public function testImplicitDefaultTestSuiteMultipleBeforeAllHooksAllInvokedBeforeTest() { @@ -273,41 +262,39 @@ public function testExplicitTestSuiteBeforeAllTestSuiteHookTestCaseHasAccessToSa $this->parseAndRun($this->explicitTestSuitePath('BeforeAllTestSuiteHook')); $this->assertCount(3, $this->listener->getTargets()); $actual = [ - $this->listener->getTargets()[0]->getTestCase()->testSuite(), - $this->listener->getTargets()[1]->getTestCase()->testSuite(), - $this->listener->getTargets()[2]->getTestCase()->testSuite(), + $this->listener->getTargets()[0]->getTestCase()->testSuite, + $this->listener->getTargets()[1]->getTestCase()->testSuite, + $this->listener->getTargets()[2]->getTestCase()->testSuite, ]; $this->assertSame($actual[0], $actual[1]); $this->assertSame($actual[1], $actual[2]); } public function testTestPassedEventsEmittedAfterTestProcessedEvent() { - $listener = $this->createRecordingListener([ - Events::TEST_PROCESSED, - Events::TEST_PASSED - ]); - $this->emitter->register($listener); + $listener = $this->createRecordingListener(); + foreach ([Events::TEST_PROCESSED, Events::TEST_PASSED] as $event) { + $this->emitter->register($event, $listener); + } $this->parseAndRun($this->implicitDefaultTestSuitePath('SingleTest')); $this->assertSame([Events::TEST_PROCESSED, Events::TEST_PASSED], $listener->actual); } public function testTestFailedEventsEmittedAfterTestProcessedEvent() { - $listener = $this->createRecordingListener([ - Events::TEST_PROCESSED, - Events::TEST_FAILED - ]); - $this->emitter->register($listener); + $listener = $this->createRecordingListener(); + foreach ([Events::TEST_PROCESSED, Events::TEST_FAILED] as $event) { + $this->emitter->register($event, $listener); + } $this->parseAndRun($this->implicitDefaultTestSuitePath('FailedAssertion')); $this->assertSame([Events::TEST_PROCESSED, Events::TEST_FAILED], $listener->actual); } public function testTestErrorEventEmittedAfterTestProcessedEvent() { - $listener = $this->createRecordingListener([ - Events::TEST_PROCESSED, Events::TEST_ERRORED - ]); - $this->emitter->register($listener); + $listener = $this->createRecordingListener(); + foreach ([Events::TEST_PROCESSED, Events::TEST_ERRORED] as $event) { + $this->emitter->register($event, $listener); + } $this->parseAndRun($this->implicitDefaultTestSuitePath('ExceptionThrowingTest')); @@ -315,35 +302,30 @@ public function testTestErrorEventEmittedAfterTestProcessedEvent() { } public function testTestDisabledEventsEmittedAfterTestProcessedEvent() { - $listener = $this->createRecordingListener([ - Events::TEST_PROCESSED, Events::TEST_DISABLED - ]); - $this->emitter->register($listener); + $listener = $this->createRecordingListener(); + foreach ([Events::TEST_PROCESSED, Events::TEST_DISABLED] as $event) { + $this->emitter->register($event, $listener); + } $this->parseAndRun($this->implicitDefaultTestSuitePath('SingleTestDisabled')); $this->assertSame([Events::TEST_PROCESSED, Events::TEST_DISABLED], $listener->actual); } public function testTestSuiteStartedAndFinishedEventsEmittedInOrder() { - $actual = []; - $listener = $this->createRecordingListener([ - Events::TEST_SUITE_STARTED, - Events::TEST_PROCESSED, - Events::TEST_SUITE_FINISHED - ]); - $this->emitter->register($listener); + $listener = $this->createRecordingListener(); + foreach ([Events::TEST_SUITE_STARTED, Events::TEST_PROCESSED, Events::TEST_SUITE_FINISHED] as $event) { + $this->emitter->register($event, $listener); + } $this->parseAndRun($this->implicitDefaultTestSuitePath('SingleTest')); $this->assertSame([Events::TEST_SUITE_STARTED, Events::TEST_PROCESSED, Events::TEST_SUITE_FINISHED], $listener->actual); } public function testTestCaseProcessingEventEmitted() { - $listener = $this->createRecordingListener([ - Events::TEST_CASE_STARTED, - Events::TEST_PROCESSED, - Events::TEST_CASE_FINISHED - ]); - $this->emitter->register($listener); + $listener = $this->createRecordingListener(); + foreach ([Events::TEST_CASE_STARTED, Events::TEST_PROCESSED, Events::TEST_CASE_FINISHED] as $event) { + $this->emitter->register($event, $listener); + } $this->parseAndRun($this->implicitDefaultTestSuitePath('SingleTest')); $this->assertSame([Events::TEST_CASE_STARTED, Events::TEST_PROCESSED, Events::TEST_CASE_FINISHED], $listener->actual); @@ -436,7 +418,7 @@ public function testExplicitTestSuiteTestSuiteDisabledHookNotInvoked() { $testSomethingResult = $this->fetchTestResultForTest(ExplicitTestSuite\TestSuiteDisabledHookNotInvoked\MyTestCase::class, 'testSomething'); $this->assertSame(TestState::Disabled, $testSomethingResult->getState()); - $this->assertSame([], $testSomethingResult->getTestCase()->testSuite()->getState()); + $this->assertSame([], $testSomethingResult->getTestCase()->testSuite->getState()); } public function testImplicitDefaultTestSuiteTestDisabledCustomMessage() { @@ -579,12 +561,10 @@ public function testImplicitDefaultTestSuiteTestExpectsExceptionDoesNotThrow() { } public function testTestProcessingEventsEmittedInOrder() { - $listener = $this->createRecordingListener([ - Events::TEST_PROCESSED, - Events::PROCESSING_FINISHED, - Events::PROCESSING_STARTED - ]); - $this->emitter->register($listener); + $listener = $this->createRecordingListener(); + foreach ([Events::TEST_PROCESSED, Events::PROCESSING_FINISHED, Events::PROCESSING_STARTED] as $event) { + $this->emitter->register($event, $listener); + } $this->parseAndRun($this->implicitDefaultTestSuitePath('SingleTest')); $this->assertSame([Events::PROCESSING_STARTED, Events::TEST_PROCESSED, Events::PROCESSING_FINISHED], $listener->actual); @@ -605,14 +585,6 @@ public function testImplicitDefaultTestSuiteExpectsNoAssertionsAssertMade() : vo $this->assertSame('Expected ' . ImplicitDefaultTestSuite\TestExpectsNoAssertionsAssertMade\MyTestCase::class . '::testNoAssertionAssertionMade to make 0 assertions but made 2', $this->listener->getTargets()[0]->getException()->getMessage()); } - public function testImplicitDefaultTestSuiteExpectsNoAssertionsAsyncAssertMade() : void { - $this->parseAndRun($this->implicitDefaultTestSuitePath('TestExpectsNoAsyncAssertionsAssertMade')); - - $this->assertCount(1, $this->listener->getTargets()); - $this->assertSame(TestState::Failed, $this->listener->getTargets()[0]->getState()); - $this->assertSame('Expected ' . ImplicitDefaultTestSuite\TestExpectsNoAsyncAssertionsAssertMade\MyTestCase::class . '::noAssertionButAsyncAssertionMade to make 0 assertions but made 2', $this->listener->getTargets()[0]->getException()->getMessage()); - } - public function testImplicitDefaultTestSuiteTestHasTimeoutExceedsValueIsFailedTest() : void { $this->parseAndRun($this->implicitDefaultTestSuitePath('TestHasTimeout')); @@ -656,7 +628,7 @@ public function testImplicitDefaultTestSuiteSingleMockTestWithBridgeSetInitializ public function testImplicitDefaultTestSuiteSingleMockTestWithFailingBridgeHasFailedTest() : void { $this->buildTestSuiteRunner(); - $this->emitter->register($this->listener); + $this->emitter->register(Events::TEST_PROCESSED, $this->listener); $this->testSuiteRunner->setMockBridgeClass(FailingMockBridgeStub::class); $this->parseAndRun($this->implicitDefaultTestSuitePath('SingleMockTest')); @@ -734,7 +706,7 @@ public function testExplicitTestSuiteTestSuiteHookPriority() { 'afterAllTwo', 'afterAllThree', ]; - $this->assertEquals($expected, $testResult->getTestCase()->testSuite()->getInvokedHooks()); + $this->assertEquals($expected, $testResult->getTestCase()->testSuite->getInvokedHooks()); } private function fetchTestResultForTest(string $testClass, string $method) : TestResult { diff --git a/framework_test/UsesAcmeSrc.php b/tests/Unit/Framework/UsesAcmeSrc.php similarity index 78% rename from framework_test/UsesAcmeSrc.php rename to tests/Unit/Framework/UsesAcmeSrc.php index b95b43f..a136701 100644 --- a/framework_test/UsesAcmeSrc.php +++ b/tests/Unit/Framework/UsesAcmeSrc.php @@ -1,11 +1,11 @@