for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Firesphere\SolrSearch\Tests;
use Firesphere\SolrSearch\Helpers\Synonyms;
use SilverStripe\Dev\SapphireTest;
class SynonymsTest extends SapphireTest
{
public function testGetSynonyms()
$synonyms = Synonyms::config()->get('synonyms');
$this->assertEquals($synonyms, Synonyms::getSynonyms());
}
public function testGetSynonymsAsString()
$rendered = Synonyms::getSynonymsAsString();
$this->assertStringEndsWith("\n", $rendered);
// Add 1 to the count, because the rendered string ends with a newline, thus adding one item to the array
$this->assertCount(count($synonyms) + 1, explode("\n", $rendered));