<commit_before><?php

class CMSMainTest extends SapphireTest {
	static $fixture_file = 'cms/tests/CMSMainTest.yml';
	
	/**
	 * @todo Test the results of a publication better
	 */
	function testPublish() {
		$session = new Session(array(
			'loggedInAs' => $this->idFromFixture('Member', 'admin')
		));
		
		$response = Director::test("admin/cms/publishall", array('confirm' => 1), $session);
		$this->assertContains('Done: Published 5 pages', $response->getBody());

		$response = Director::test("admin/cms/publishitems", array('csvIDs' => '1,2', 'ajax' => 1), $session);
		$this->assertContains('setNodeTitle(1, \'Page 1\');', $response->getBody());
		$this->assertContains('setNodeTitle(2, \'Page 2\');', $response->getBody());
		
		
		
		//$this->assertRegexp('/Done: Published 4 pages/', $response->getBody())
			<commit_msg>BUGFIX Fixed CMSMainTest to check for translated entities to avoid failing tests with i18n enabled<commit_after><?php

class CMSMainTest extends SapphireTest {
	static $fixture_file = 'cms/tests/CMSMainTest.yml';
	
	/**
	 * @todo Test the results of a publication better
	 */
	function testPublish() {
		$session = new Session(array(
			'loggedInAs' => $this->idFromFixture('Member', 'admin')
		));
		
		$response = Director::test("admin/cms/publishall", array('confirm' => 1), $session);
		$this->assertContains(
			sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), 5), 
			$response->getBody()
		);

		$response = Director::test("admin/cms/publishitems", array('csvIDs' => '1,2', 'ajax' => 1), $session);
		$this->assertContains('setNodeTitle(1, \'Page 1\');', $response->getBody());
		$this->assertContains('setNodeTitle(2, \'Page 2\');', $response->getBody());
		
		
		
		//$this->assertRegexp('/Done: Published 4 pages/', $response->getBody())
			
{'fraction_non_alphanumeric': 0.19553072625698323, 'fraction_numerical': 0.012290502793296089, 'mean_word_length': 4.852941176470588, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6574264', 'n_tokens_mistral': 662, 'n_tokens_neox': 569, 'n_words': 124}