1
0
Fork 0

Merge branch 'master' into feature/autocomplete-speedup

pull/451/head
Felix Becker 2017-11-15 15:44:25 -08:00 committed by GitHub
commit 7511e255ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 1 deletions

View File

@ -58,7 +58,7 @@ jobs:
stages:
- test
- name: release
if: branch = master
if: branch = master AND type = push AND fork = false
branches:
except:

30
tests/Index/IndexTest.php Normal file
View File

@ -0,0 +1,30 @@
<?php
namespace LanguageServer\Tests;
use PHPUnit\Framework\TestCase;
use LanguageServer\Index\Index;
use LanguageServer\Definition;
class IndexTest extends TestCase
{
public function testGetSetMethodDefinition()
{
$index = new Index;
$index->setDefinition('SomeNamespace\SomeClass', new Definition);
$methodDefinition = new Definition;
$methodFqn = 'SomeNamespace\SomeClass->someMethod()';
$index->setDefinition($methodFqn, $methodDefinition);
$index->setDefinition('SomeNamespace\SomeClass->someProperty', new Definition);
$this->assertSame($methodDefinition, $index->getDefinition($methodFqn));
}
public function testGetSetClassDefinition()
{
$index = new Index;
$definition = new Definition;
$fqn = 'SomeNamespace\SomeClass';
$index->setDefinition($fqn, $definition);
$this->assertSame($definition, $index->getDefinition($fqn));
}
}