Tests/Services/DocumentServiceTest.php
author ymh <ymh.work@gmail.com>
Tue, 06 Dec 2011 14:53:12 +0100
changeset 57 186c4121c7b3
child 63 774ba82dca59
permissions -rw-r--r--
add service tp copy tag from one document to another
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/*
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * This file is part of the WikiTagBundle package.
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * (c) IRI <http://www.iri.centrepompidou.fr/>
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 *
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * For the full copyright and license information, please view the LICENSE
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * file that was distributed with this source code.
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 */
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
namespace IRI\Bundle\WikiTagBundle\Tests\Services;
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
require_once(__DIR__ . "/../../../../../../../app/AppKernel.php");
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
class DocumentServiceTest extends \PHPUnit_Framework_TestCase
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
{
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
    protected $_container;
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
    
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
    public function __construct()
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
    {
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
        $kernel = new \AppKernel("test", true);
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
        $kernel->boot();
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
        $this->_container = $kernel->getContainer();
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
        parent::__construct();
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
    }
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
    
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
    protected function get($service)
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
    {
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
        return $this->_container->get($service);
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
    }
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
    
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
        
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
    public function testCopyTags()
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
    {
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
    
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
        $search_service = $this->get("wiki_tag.document");
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
        
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
        // TODO : get doc 1
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
        // TODO : get doc 2
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
        // call copyTags
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
    
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
    }
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
    
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
    
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
}
186c4121c7b3 add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47