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.



Your result can be seen below.

Result of php executing





Full code of test.php

  1. <?php
  2.  
  3. use Aspiria\AXL\Models\ServiceProfile;
  4.  
  5. class ServiceProfileTest extends AxlTestCase
  6. {
  7.     public function testBasicFunctions()
  8.     {
  9.         $serviceProfile = new ServiceProfile([
  10.             'name'          => $this->faker->numerify('sp_######'),
  11.             'description'   => $this->faker->numerify('sp_description')
  12.         ]);
  13.  
  14.         $uuid = $this->client->addServiceProfile($serviceProfile);
  15.         $this->assertUuid($uuid);
  16.  
  17.         $createdServiceProfile = $this->client->getServiceProfile(['uuid' => $uuid]);
  18.         $this->assertInstanceOf(ServiceProfile::class, $createdServiceProfile);
  19.  
  20.         $this->compare($serviceProfile, $createdServiceProfile);
  21.  
  22.         $uuid = $this->client->removeServiceProfile($serviceProfile);
  23.         $this->assertUuid($uuid);
  24.     }
  25.  
  26.     /**
  27.      * Function compares and asserts if the two provided ServiceProfile are the same
  28.      *
  29.      * @param \Aspiria\AXL\Models\ServiceProfile $serviceProfile1
  30.      * @param \Aspiria\AXL\Models\ServiceProfile $serviceProfile2
  31.      */
  32.     private function compare(ServiceProfile $serviceProfile1, ServiceProfile $serviceProfile2)
  33.     {
  34.         $this->assertAttributeEquals($serviceProfile1->description, 'description', $serviceProfile2);
  35.     }
  36. }
File Description
  • test
  • PHP Code
  • 24 Jun-2019
  • 1.21 Kb
You can Share it: