The code beneath is in my test class, but when I create a drupal user with the 'user test amfservice' permissions the creation fails (see screenshot of the test).
The 'use test amfservice' is a valid permission in the amfserver module.
Anyone have a clue? Do I need to set it first?

require_once 'SabreAMF/Client.php';

class AmfServerTestCase extends ServicesWebtestCase {
  
  protected $privileged_user = NULL;
  protected $endpoint = NULL;
  protected $client = NULL;
  protected $endpoint_url = NULL;
  

  /**
   * Implementation of setUp().
   */
  public function setUp() {
    parent::setUp ( 'amfserver' );
    // Set up endpoint.
    $this->endpoint = $this->saveAMFEndpoint ();
    $this->endpoint_url = $this->getAbsoluteUrl ( $this->endpoint->path );
    $this->client = new SabreAMF_Client ( $this->endpoint_url );
    $this->client->setEncoding ( 3 );
  }

public function testEndPoint() {
    $page = $this->getEndpoint ( $this->endpoint_url );
    $this->assertContainsText ( $page, 'The amfserver with Zend AMF is installed and working.', 'endpoint call in browser functions normally: ' . substr ( $page, 0, 150 ) . "....", 'amfserver: test' );

    $this->privileged_user = $this->drupalCreateUser(array('administer users', 'access user profiles', 'use test amfservice'));
    $this->drupalLogin($this->privileged_user);

    $page = $this->getEndpoint ( $this->endpoint_url );
    $this->assertContainsText ( $page, 'The amfserver with Zend AMF is installed and working.', 'endpoint call in browser (with logged in user) functions normally: ' . substr ( $page, 0, 150 ) . "....", 'amfserver: test' );
  }

Comments

kylebrowning’s picture

Project: Services » SimpleTest
Version: 7.x-3.x-dev » 7.x-2.x-dev

This is a simpletest Support Request.

patrickd’s picture

Got the same problem here on my working station.

Any test (eg. node.test) produces permission errors like "invalid permission ´create page content´"
But it works on my laptop.

rolf vreijdenberger’s picture

hi Patrick,

what would be the obvious differences in your setup between the laptop and the workstation?
I use a mamp installation on my mac.
what do you use?

patrickd’s picture

It's all very strange:

My laptop has a standart apache2/PHP5 installation
My workstation is the same but we are using workflow automation by different shell scripts (like creating new sites)
so I thought this is the problem

but my workmate uses exactly the same configuration (ubuntu clones) and it works good for him..

Too hard to guess what the problem is, I'll reinstall the clone hoping it will work then