Skip to content

Commit

Permalink
büyük-küçük harf dönüşümleri için test ekle
Browse files Browse the repository at this point in the history
  • Loading branch information
aozisik committed Apr 27, 2018
1 parent f334f9d commit 043f4e2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Sozcuk.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public function den()

public function kucuk()
{
$str = str_replace(['i', 'I'], ['İ', 'ı'], $str);
$str = str_replace(['i', 'I'], ['İ', 'ı'], $this->soz);
return mb_strtolower($str, 'UTF-8');
}

public function buyuk()
{
$str = str_replace(['i', 'I'], ['İ', 'ı'], $str);
$str = str_replace(['i', 'I'], ['İ', 'ı'], $this->soz);
return mb_strtoupper($str, 'UTF-8');
}

Expand Down
36 changes: 36 additions & 0 deletions tests/LetterCaseTests.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use PHPUnit\Framework\TestCase;

class LetterCaseTests extends TestCase
{
/**
* @test
*/
public function kucuk_harfe_cevir()
{
$this->assertEquals('çılgın koşu', tr('ÇIlgın KoŞu')->kucuk());
$this->assertEquals('iyelik ekleri', tr('İyelİk eklerİ')->kucuk());
$this->assertEquals('ılık rüzgarlar', tr('ıLIK RÜZGARLAR')->kucuk());
$this->assertEquals('izmir\'de ılık ilkbahar akşamı', tr('İzmir\'de Ilık İlkbahar akşamı')->kucuk());
}

/**
* @test
*/
public function buyuk_harfe_cevir()
{
$this->assertEquals('IĞDIR\'DA ILIK İLKBAHAR AKŞAMI', tr('Iğdır\'da Ilık İlkbahar akşamı')->buyuk());
}

/**
* @test
*/
public function baslik_gibi_yap()
{
$this->assertEquals('Çılgın Koşu', tr('ÇILgın koŞu')->baslik());
$this->assertEquals('İyelik Ekleri', tr('iYelik eklerİ')->baslik());
$this->assertEquals('Ilık Rüzgarlar', tr('ıLIK RÜZGARLAR')->baslik());
$this->assertEquals('Iğdır\'da Ilık İlkbahar Akşamı', tr('ığdIr\'da ılIk ilkbAhar Akşamı')->baslik());
}
}

0 comments on commit 043f4e2

Please sign in to comment.