@@ -521,7 +521,7 @@ public function testChmodChangesZeroModeOnSubdirectoriesOnRecursive()
521
521
$ this ->assertFilePermissions (753 , $ subdirectory );
522
522
}
523
523
524
- public function testChown ()
524
+ public function testChownByName ()
525
525
{
526
526
$ this ->markAsSkippedIfPosixIsMissing ();
527
527
@@ -534,7 +534,20 @@ public function testChown()
534
534
$ this ->assertSame ($ owner , $ this ->getFileOwner ($ dir ));
535
535
}
536
536
537
- public function testChownRecursive ()
537
+ public function testChownById ()
538
+ {
539
+ $ this ->markAsSkippedIfPosixIsMissing ();
540
+
541
+ $ dir = $ this ->workspace .\DIRECTORY_SEPARATOR .'dir ' ;
542
+ mkdir ($ dir );
543
+
544
+ $ ownerId = $ this ->getFileOwnerId ($ dir );
545
+ $ this ->filesystem ->chown ($ dir , $ ownerId );
546
+
547
+ $ this ->assertSame ($ ownerId , $ this ->getFileOwnerId ($ dir ));
548
+ }
549
+
550
+ public function testChownRecursiveByName ()
538
551
{
539
552
$ this ->markAsSkippedIfPosixIsMissing ();
540
553
@@ -549,6 +562,21 @@ public function testChownRecursive()
549
562
$ this ->assertSame ($ owner , $ this ->getFileOwner ($ file ));
550
563
}
551
564
565
+ public function testChownRecursiveById ()
566
+ {
567
+ $ this ->markAsSkippedIfPosixIsMissing ();
568
+
569
+ $ dir = $ this ->workspace .\DIRECTORY_SEPARATOR .'dir ' ;
570
+ mkdir ($ dir );
571
+ $ file = $ dir .\DIRECTORY_SEPARATOR .'file ' ;
572
+ touch ($ file );
573
+
574
+ $ ownerId = $ this ->getFileOwnerId ($ dir );
575
+ $ this ->filesystem ->chown ($ dir , $ ownerId , true );
576
+
577
+ $ this ->assertSame ($ ownerId , $ this ->getFileOwnerId ($ file ));
578
+ }
579
+
552
580
public function testChownSymlink ()
553
581
{
554
582
$ this ->markAsSkippedIfSymlinkIsMissing ();
@@ -624,7 +652,7 @@ public function testChownFail()
624
652
$ this ->filesystem ->chown ($ dir , 'user ' .time ().mt_rand (1000 , 9999 ));
625
653
}
626
654
627
- public function testChgrp ()
655
+ public function testChgrpByName ()
628
656
{
629
657
$ this ->markAsSkippedIfPosixIsMissing ();
630
658
@@ -637,6 +665,19 @@ public function testChgrp()
637
665
$ this ->assertSame ($ group , $ this ->getFileGroup ($ dir ));
638
666
}
639
667
668
+ public function testChgrpById ()
669
+ {
670
+ $ this ->markAsSkippedIfPosixIsMissing ();
671
+
672
+ $ dir = $ this ->workspace .\DIRECTORY_SEPARATOR .'dir ' ;
673
+ mkdir ($ dir );
674
+
675
+ $ groupId = $ this ->getFileGroupId ($ dir );
676
+ $ this ->filesystem ->chgrp ($ dir , $ groupId );
677
+
678
+ $ this ->assertSame ($ groupId , $ this ->getFileGroupId ($ dir ));
679
+ }
680
+
640
681
public function testChgrpRecursive ()
641
682
{
642
683
$ this ->markAsSkippedIfPosixIsMissing ();
@@ -652,7 +693,7 @@ public function testChgrpRecursive()
652
693
$ this ->assertSame ($ group , $ this ->getFileGroup ($ file ));
653
694
}
654
695
655
- public function testChgrpSymlink ()
696
+ public function testChgrpSymlinkByName ()
656
697
{
657
698
$ this ->markAsSkippedIfSymlinkIsMissing ();
658
699
@@ -669,6 +710,23 @@ public function testChgrpSymlink()
669
710
$ this ->assertSame ($ group , $ this ->getFileGroup ($ link ));
670
711
}
671
712
713
+ public function testChgrpSymlinkById ()
714
+ {
715
+ $ this ->markAsSkippedIfSymlinkIsMissing ();
716
+
717
+ $ file = $ this ->workspace .\DIRECTORY_SEPARATOR .'file ' ;
718
+ $ link = $ this ->workspace .\DIRECTORY_SEPARATOR .'link ' ;
719
+
720
+ touch ($ file );
721
+
722
+ $ this ->filesystem ->symlink ($ file , $ link );
723
+
724
+ $ groupId = $ this ->getFileGroupId ($ link );
725
+ $ this ->filesystem ->chgrp ($ link , $ groupId );
726
+
727
+ $ this ->assertSame ($ groupId , $ this ->getFileGroupId ($ link ));
728
+ }
729
+
672
730
public function testChgrpLink ()
673
731
{
674
732
$ this ->markAsSkippedIfLinkIsMissing ();
0 commit comments