test - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of test.php
- <?php
- use Aspiria\AXL\Models\ServiceProfile;
- class ServiceProfileTest extends AxlTestCase
- {
- public function testBasicFunctions()
- {
- $serviceProfile = new ServiceProfile([
- 'name' => $this->faker->numerify('sp_######'),
- 'description' => $this->faker->numerify('sp_description')
- ]);
- $uuid = $this->client->addServiceProfile($serviceProfile);
- $this->assertUuid($uuid);
- $createdServiceProfile = $this->client->getServiceProfile(['uuid' => $uuid]);
- $this->assertInstanceOf(ServiceProfile::class, $createdServiceProfile);
- $this->compare($serviceProfile, $createdServiceProfile);
- $uuid = $this->client->removeServiceProfile($serviceProfile);
- $this->assertUuid($uuid);
- }
- /**
- * Function compares and asserts if the two provided ServiceProfile are the same
- *
- * @param \Aspiria\AXL\Models\ServiceProfile $serviceProfile1
- * @param \Aspiria\AXL\Models\ServiceProfile $serviceProfile2
- */
- private function compare(ServiceProfile $serviceProfile1, ServiceProfile $serviceProfile2)
- {
- $this->assertAttributeEquals($serviceProfile1->description, 'description', $serviceProfile2);
- }
- }