RestfulCreateTaxonomyTermTestCase.test in RESTful 7
Same filename and directory in other branches
Contains RestfulCreateTaxonomyTermTestCase
File
tests/RestfulCreateTaxonomyTermTestCase.testView source
<?php
/**
* @file
* Contains RestfulCreateTaxonomyTermTestCase
*/
class RestfulCreateTaxonomyTermTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Taxonomy term integration',
'description' => 'Test the creation of a taxonomy term entity type.',
'group' => 'RESTful',
);
}
function setUp() {
parent::setUp('restful_test');
}
/**
* Test the creation of a taxonomy term entity type.
*/
function testCreate() {
$user1 = $this
->drupalCreateUser(array(
'create article content',
));
$this
->drupalLogin($user1);
$handler = restful_get_restful_handler('test_tags');
$handler
->setAccount($user1);
$text1 = $this
->randomName();
$request = array(
'label' => $text1,
);
$result = $handler
->post('', $request);
$id = $result[0]['id'];
$this
->assertTrue($id, 'Term was created by a non-admin user.');
}
}
Classes
Name | Description |
---|---|
RestfulCreateTaxonomyTermTestCase | @file Contains RestfulCreateTaxonomyTermTestCase |