Skip to content

Commit

Permalink
Switch to $this->assert* instead of self::assert*
Browse files Browse the repository at this point in the history
  • Loading branch information
andyexeter committed Apr 29, 2024
1 parent 78f65e9 commit 00ff451
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions tests/DataBindingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public function testObjectTwoWayDataBinding()
'interests' => ['football', 'gaming'],
]);

self::assertSame($person->name, 'John Smith');
self::assertSame($person->emailAddress, 'john.smith@example.org');
self::assertSame($person->getAge(), 42);
self::assertSame($person->getFavouriteConsole(), 'PlayStation');
self::assertSame($person->interests, ['football', 'gaming']);
$this->assertSame($person->name, 'John Smith');
$this->assertSame($person->emailAddress, 'john.smith@example.org');
$this->assertSame($person->getAge(), 42);
$this->assertSame($person->getFavouriteConsole(), 'PlayStation');
$this->assertSame($person->interests, ['football', 'gaming']);
}

public function testArrayOneWayDataBinding()
Expand All @@ -49,11 +49,11 @@ public function testArrayOneWayDataBinding()

$form = $this->buildForm($person);

self::assertSame($form->get('name')->getData(), 'John Smith');
self::assertSame($form->get('emailAddress')->getData(), 'john.smith@example.org');
self::assertSame($form->get('age')->getData(), 42);
self::assertSame($form->get('favouriteConsole')->getData(), 'PlayStation');
self::assertSame($form->get('interests')->getData(), ['football', 'gaming']);
$this->assertSame($form->get('name')->getData(), 'John Smith');
$this->assertSame($form->get('emailAddress')->getData(), 'john.smith@example.org');
$this->assertSame($form->get('age')->getData(), 42);
$this->assertSame($form->get('favouriteConsole')->getData(), 'PlayStation');
$this->assertSame($form->get('interests')->getData(), ['football', 'gaming']);
}

public function testArrayAccessTwoWayDataBinding()
Expand All @@ -70,11 +70,11 @@ public function testArrayAccessTwoWayDataBinding()

$form = $this->buildForm($person);

self::assertSame($form->get('name')->getData(), 'John Smith');
self::assertSame($form->get('emailAddress')->getData(), 'john.smith@example.org');
self::assertSame($form->get('age')->getData(), 42);
self::assertSame($form->get('favouriteConsole')->getData(), 'PlayStation');
self::assertSame($form->get('interests')->getData(), ['football', 'gaming']);
$this->assertSame($form->get('name')->getData(), 'John Smith');
$this->assertSame($form->get('emailAddress')->getData(), 'john.smith@example.org');
$this->assertSame($form->get('age')->getData(), 42);
$this->assertSame($form->get('favouriteConsole')->getData(), 'PlayStation');
$this->assertSame($form->get('interests')->getData(), ['football', 'gaming']);

$form->submit([
'name' => 'Bob Smith',
Expand All @@ -84,11 +84,11 @@ public function testArrayAccessTwoWayDataBinding()
'interests' => ['guitar'],
]);

self::assertSame($person['name'], 'Bob Smith');
self::assertSame($person['emailAddress'], 'bob.smith@example.org');
self::assertSame($person['age'], 45);
self::assertSame($person['favouriteConsole'], 'Xbox');
self::assertSame($person['interests'], ['guitar']);
$this->assertSame($person['name'], 'Bob Smith');
$this->assertSame($person['emailAddress'], 'bob.smith@example.org');
$this->assertSame($person['age'], 45);
$this->assertSame($person['favouriteConsole'], 'Xbox');
$this->assertSame($person['interests'], ['guitar']);
}

public function testStdClassTwoWayDataBinding(): void
Expand All @@ -104,11 +104,11 @@ public function testStdClassTwoWayDataBinding(): void

$form = $this->buildForm($person);

self::assertSame($form->get('name')->getData(), 'John Smith');
self::assertSame($form->get('emailAddress')->getData(), 'john.smith@example.org');
self::assertSame($form->get('age')->getData(), 42);
self::assertSame($form->get('favouriteConsole')->getData(), 'PlayStation');
self::assertSame($form->get('interests')->getData(), ['football', 'gaming']);
$this->assertSame($form->get('name')->getData(), 'John Smith');
$this->assertSame($form->get('emailAddress')->getData(), 'john.smith@example.org');
$this->assertSame($form->get('age')->getData(), 42);
$this->assertSame($form->get('favouriteConsole')->getData(), 'PlayStation');
$this->assertSame($form->get('interests')->getData(), ['football', 'gaming']);

$form->submit([
'name' => 'Bob Smith',
Expand All @@ -118,11 +118,11 @@ public function testStdClassTwoWayDataBinding(): void
'interests' => ['guitar'],
]);

self::assertSame($person->name, 'Bob Smith');
self::assertSame($person->emailAddress, 'bob.smith@example.org');
self::assertSame($person->age, 45);
self::assertSame($person->favouriteConsole, 'Xbox');
self::assertSame($person->interests, ['guitar']);
$this->assertSame($person->name, 'Bob Smith');
$this->assertSame($person->emailAddress, 'bob.smith@example.org');
$this->assertSame($person->age, 45);
$this->assertSame($person->favouriteConsole, 'Xbox');
$this->assertSame($person->interests, ['guitar']);
}

public function testArrayDataMapperThrowsOutOfBoundsException(): void
Expand Down Expand Up @@ -199,7 +199,7 @@ public function testCollectionOneWayDataBinding(): void

$formPeople = $form->get('people')->getData();

self::assertSame($data['people'], $formPeople);
$this->assertSame($data['people'], $formPeople);
}

public function testCollectionTwoWayDataBinding(): void
Expand Down Expand Up @@ -240,11 +240,11 @@ public function testCollectionTwoWayDataBinding(): void
],
]);

self::assertSame($data['people'][0]['name'], 'Bob Smith');
self::assertSame($data['people'][0]['emailAddress'], 'bob.smith@example.org');
self::assertSame($data['people'][0]['age'], 45);
self::assertSame($data['people'][0]['favouriteConsole'], 'Xbox');
self::assertSame($data['people'][0]['interests'], ['guitar']);
$this->assertSame($data['people'][0]['name'], 'Bob Smith');
$this->assertSame($data['people'][0]['emailAddress'], 'bob.smith@example.org');
$this->assertSame($data['people'][0]['age'], 45);
$this->assertSame($data['people'][0]['favouriteConsole'], 'Xbox');
$this->assertSame($data['people'][0]['interests'], ['guitar']);
}

/**
Expand Down

0 comments on commit 00ff451

Please sign in to comment.