-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#124 Implemented helper to generate test state #162
Changes from 5 commits
6dafe33
f649354
644ac5e
3af8467
85b2278
f533533
d1abf05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -37,6 +37,28 @@ public function testInitialization() | |||||||
$this->assertEquals($originRecords, $state); | ||||||||
} | ||||||||
|
||||||||
public function testInitializationViaPrepareModelTestState() | ||||||||
{ | ||||||||
$datasetMock = collect($this->getJsonFixture('initialization/dataset.json')); | ||||||||
$this->mockGettingDataset($datasetMock); | ||||||||
|
||||||||
$mock = $this->getMockBuilder(TestCase::class) | ||||||||
->disableOriginalConstructor() | ||||||||
->getMockForAbstractClass(); | ||||||||
|
||||||||
$reflection = new ReflectionClass($mock); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
$this->assertFalse($reflection->getProperty('globalExportMode')->getValue($mock)); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no reasons to check the initial value of the test case class |
||||||||
|
||||||||
$setGlobalExportMode = $reflection->getMethod('setGlobalExportMode'); | ||||||||
$setGlobalExportMode->invoke($mock); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
$prepareModelTestState = $reflection->getMethod('prepareModelTestState'); | ||||||||
$prepareModelTestState->invoke($mock, TestModel::class); | ||||||||
|
||||||||
$this->assertTrue($reflection->getProperty('globalExportMode')->getValue($mock)); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what this test case testing? you need to test that the global export mode property of created test state has the same value as in the TestCase class |
||||||||
} | ||||||||
|
||||||||
public function testAssertChangesEqualsFixture() | ||||||||
{ | ||||||||
$initialDatasetMock = collect($this->getJsonFixture('changes_equals_fixture/initial_dataset.json')); | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.